GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — geode-examples/persistence/README.md at develop · apache/geode-examples

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
61 lines (38 loc) · 2.08 KB
/

README.md

Copy path

File metadata and controls

61 lines (38 loc) · 2.08 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Geode Persistence Example

This is a simple example that demonstrates persistent regions.

The data for a region resides in memory in the JVM for the server. When a region is persistent, the data for that region is also preserved in a disk store. The disk store uses a directory in a file system to save the operations on regions. Unlike non-persistent regions, the data for a persistent region is available even after a period where no servers for that region are running.

This example assumes you have installed Java and Geode.

Steps

  1. From the geode-examples/persistence directory, build the example, and run unit tests.

     $ ../gradlew build
    
  2. Next start a locator, start a server, create a disk store, and create a persistent region.

     $ gfsh run --file=scripts/start.gfsh
    
  3. Run the example to increment an entry the region.

     $ ../gradlew run
    
  4. Observe that the first time an initial value is used.

     Initialized counter to 0
     Incremented counter to 1
    
  5. Restart down the server.

     $ gfsh run --file=scripts/restart.gfsh
    
  6. Run the example to increment an entry the region.

     $ ../gradlew run
    
  7. Observe that the second time the previous value is used.

     Retrieved counter of 1
     Incremented counter to 2
    
  8. Shut down the system.

     $ gfsh run --file=scripts/stop.gfsh
    
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.