GemFire Enterprise Native Client

C++ Programming Example

November 2008

About the cqQuery Example

The cqQuery example demonstrates the native client C++ API for continuous query. The cqQuery example is located in NativeClient_xxxx/examples/cqQuery.

The client application comes with a cache configuration file, clientCqQuery.xml, which is configured to create a root region and establish the native client endpoints to the locally-run server by specifying localhost:50505. If java server is located on another host, you can change localhost to that host accordingly.

Configuring the Environment

The following is a list of the environment configuration commands for the cqQuery example. Choose the set of commands that are appropriate for your operating system. The text that you type is shown in bold.

Bourne and Korn shells (sh, ksh, bash)

% GFCPP=<path to NativeClient_xxxx directory>; export GFCPP
% PATH=$GFCPP/bin:$PATH; export PATH


The Windows native client installer sets the required environment configurations for you, so they are listed for reference only.

> GFCPP=<path to NativeClient_xxxx directory>

Running cqQuery

Follow these steps to run the cqQuery example. The steps reflect Windows operations, so alter them as needed for your operating system.

When you're prompted to enter the name of the native client directory, replace the xxxx in NativeClient_xxxx with the actual four-digit product version number. Note that step 1, 3, 4 can be run on other operating system hosts.

1.      Create a session, then configure the session environment according to the steps listed in Configuring the Environment.

  1. Go to the cqQuery example directory.


cd \NativeClient_xxxx\examples\cqQuery

  1. Enter the following commands to start the example:

1)    startServer.bat

2)      runCqQuery.bat

3)      In another window, runUpdater.bat <itr number>, where <itr number> is the number of iterations you want this program to run, e.g, 500.

4)      stopServer.bat when finished.


Changing System Parameters

By default, this product ships configured for multicast membership resolution. If your network environment does not allow multicast, you can configure GemFire for unicast. See the GemFire Enterprise System Administrator's Guide for instructions on configuring TCP transport for membership and discovery.


Copyright © 2005-2008 by GemStone Systems, Inc. All rights reserved. GemStone®, GemFire®, and the GemStone logo are trademarks or registered trademarks of GemStone Systems, Inc. All other trade names or trademarks are the property of their respective owners. Information in this document is subject to change without notice.