putall/src/main/java/org/apache/geode_examples/putall/Example.java [28:56]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class Example {
  private final Region<Integer, String> region;

  public Example(Region<Integer, String> region) {
    this.region = region;
  }

  public static void main(String[] args) {
    // connect to the locator using default port 10334
    ClientCache cache = new ClientCacheFactory().addPoolLocator("127.0.0.1", 10334)
        .set("log-level", "WARN").create();

    // create a local region that matches the server region
    Region<Integer, String> region =
        cache.<Integer, String>createClientRegionFactory(ClientRegionShortcut.PROXY)
            .create("example-region");

    Example example = new Example(region);
    example.insertValues(10);
    example.printValues(example.getValues());

    cache.close();
  }

  Set<Integer> getValues() {
    return new HashSet<>(region.keySetOnServer());
  }

  void insertValues(int upperLimit) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



replicated/src/main/java/org/apache/geode_examples/replicated/Example.java [26:54]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class Example {
  private final Region<Integer, String> region;

  public Example(Region<Integer, String> region) {
    this.region = region;
  }

  public static void main(String[] args) {
    // connect to the locator using default port 10334
    ClientCache cache = new ClientCacheFactory().addPoolLocator("127.0.0.1", 10334)
        .set("log-level", "WARN").create();

    // create a local region that matches the server region
    Region<Integer, String> region =
        cache.<Integer, String>createClientRegionFactory(ClientRegionShortcut.PROXY)
            .create("example-region");

    Example example = new Example(region);
    example.insertValues(10);
    example.printValues(example.getValues());

    cache.close();
  }

  Set<Integer> getValues() {
    return new HashSet<>(region.keySetOnServer());
  }

  void insertValues(int upperLimit) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



