@Override
  protected <K, V> RegionAttributes<K, V> getRegionAttributes(String type) {
    RegionAttributes<K, V> ra;
    if (type != null) {
      ra = super.getRegionAttributes(type);
    } else {
      ra = super.getRegionAttributes();
    }

    Compressor compressor;
    try {
      compressor = SnappyCompressor.getDefaultInstance();
    } catch (Throwable t) {
      // Not a supported OS
      return ra;
    }
    AttributesFactory<K, V> factory = new AttributesFactory<>(ra);
    if (!ra.getDataPolicy().isEmpty()) {
      factory.setCompressor(compressor);
    }
    return factory.create();
  }
Tests Partitioned Region with compression.

@since GemFire 8.0
geode-core/src/distributedTest/java/org/apache/geode/cache30/PartitionedRegionCompressionDUnitTest.java