Compression in Replicated Regions


Introduction

This example demonstrates enabling Compression in a VMware GemFire replicated region.

This is a simple example that demonstrates enabling Compression in a replicated region. The Default compression algorithm included with GemFire is Snappy. Additionally, you can specify your own compressor algorithm as well by implementing org.apache.geode.compression.Compression Interface. For enabling compression on a GemFire region you can follow the official document.

This example assumes you have installed JDK11 and GemFire.


Steps

From the gemfire-examples/compression directory, build the example and run unit tests

 $ ../gradlew build

Next start the locator, two servers and create replicated region example-region with compression enabled.

 
 $ gfsh run --file=scripts/start.gfsh
 

Run the example to create and get entries using GemFire Java Client from the region

 $ ../gradlew run

Shut down the system.

 $ gfsh run --file=scripts/stop.gfsh

On this page