This is a simple example showing how to create and execute a remote query.
GEODE_HOME
environment variable set to the location of the Apache Geode installation.GEODE_HOME/bin
in the execution path.remotequery
directory in your example workspace.$ cd workspace/examples/cpp/remotequery
startserver.sh
script to start the Geode server, create a region, and populate the region with sample data.$ sh ./startserver.sh /Users/user/geode/bin/gfsh (1) Executing - start locator --name=locator ... (2) Executing - start server --name=server ... (3) Executing - create region --name=custom_orders --type=PARTITION Member | Status ------ | ------------------------------------------- server | Region "/custom_orders" created on "server"
remotequery
:$ build/remotequery Create orders Storing orders in the region Getting the orders from the region The following orders have a quantity greater than 30: OrderID: 2 Product Name: product y Quantity: 37 OrderID: 4 Product Name: product z Quantity: 102 OrderID: 6 Product Name: product z Quantity: 42
$ sh ./stopserver.sh /Users/user/geode/bin/gfsh (1) Executing - connect ... (2) Executing - stop server --name=server ... (3) Executing - stop locator --name=locator ....