Apache Geode Examples
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
async GEODE-4153: Rename org.apache.geode.examples to org.apache.geode_exam… Jan 3, 2018
buildSrc/src/main/groovy/org/apache/geode/gradle GEODE-2318 Update build script Jan 18, 2017
clientSecurity GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
cq GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
etc GEODE-2260: Revise geode-examples to be in their own repo Jan 6, 2017
eviction GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
expiration GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
functions Adding a CQ Example Jun 22, 2018
gradle GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
indexes GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
listener GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
loader GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
lucene GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
luceneSpatial GEODE-4153: Rename org.apache.geode.examples to org.apache.geode_exam… Jan 3, 2018
overflow Clarified expected output in README.md Jun 22, 2018
partitioned GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
persistence GEODE-4153: Rename org.apache.geode.examples to org.apache.geode_exam… Jan 3, 2018
putall GEODE-4153: Rename org.apache.geode.examples to org.apache.geode_exam… Jan 3, 2018
queries GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
replicated GEODE-4153: Rename org.apache.geode.examples to org.apache.geode_exam… Jan 3, 2018
serialization GEODE-4119: Add an example of eviction. Jan 11, 2018
transaction GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
wan GEODE-5964 run geode-examples with java11 (#70) Dec 10, 2018
writer GEODE-4153: Rename org.apache.geode.examples to org.apache.geode_exam… Jan 3, 2018
.gitignore Removes native examples. Oct 23, 2017
.travis.yml GEODE-2831: Improve geode examples Apr 26, 2017
LICENSE Add license and notice files Jan 17, 2017
NOTICE Updated copyright date in NOTICE Sep 18, 2018
README.md Merge pull request #63 from apache/feature/overflow-example Jun 22, 2018
build.gradle Uses tarTree to extract distribution. Sep 5, 2018
gradle.properties Merge branch 'release/1.8.0' Dec 12, 2018
gradlew GEODE-2318 Update gradle wrapper Jan 18, 2017
settings.gradle GEODE-5414: Adding WAN example. Aug 7, 2018

README.md

Build Status License

Apache Geode examples

This is the home of Apache Geode examples that are bundled with the project. Contributions[2] and corrections are welcome. Please talk to us about your suggestions at dev@geode.apache.org or submit a pull request.

Apache Geode Version

Check out the master branch to run examples against the latest geode release.

Running an example

The gradle build will automatically download and install a Geode release in the build directory. You can run an example with the following gradle targets:

  • build - compiles the example and runs unit tests
  • start - initializes the Geode cluster
  • run - runs the example Application
  • stop - shuts down the cluster
  • runAll - invokes start, run, stop

The commands you need to invoke will be given in the README.md file. Sample usage:

$ ./gradlew :replicated:start
$ ./gradlew :replicated:run
$ ./gradlew :replicated:stop
$ ./gradlew runAll

Catalog of examples

The following sections call out ready-made examples or new examples that could be built. You may want to start your journey with the Apache Geode in 15 minutes or Less tutorial.

Basics

Intermediate

Advanced

  • Lucene Spatial Indexing
  • WAN Gateway
  • Durable subscriptions
  • Delta propagation
  • Network partition detection
  • D-lock
  • Compression
  • Resource manager
  • PDX Advanced

Use cases, integrations and external examples

This section has self-contained little projects that illustrate a use case or an integration with other projects.

  • SpringBoot Application
  • HTTP Session replication
  • Redis
  • Memcached
  • Spark Connector

Adding a new example

Follow this approach to add a new example:

  • Create a subdirectory with a descriptive name like cache-writer
  • Create a README.md file in the example subproject to walk the user through the tutorial
  • Create a Java class with a main method in the org.apache.geode_examples.$name.Example class
  • Create a cluster initialization script in scripts/start.gfsh
  • Create a cluster shutdown script in scripts/stop.gfsh
  • Modify the top-level settings.gradle file to include subproject
  • Modify this README.md file to include the new example in the catalog of examples

The scripts should contain gfsh commands for starting locators, servers, and creating regions--everything that the example program will need to use. Where appropriate you should also add unit tests. To customize the build you can add a build.gradle file.

Verify that the examples build by executing ./gradlew runAll from the root directory. Note that the build may fail if you do not add ASF license headers or use the correct formatting. You can fix formatting with ./gradlew spotlessApply.

References

Export Control

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

The following provides more details on the included cryptographic software: