geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [22/51] [partial] incubator-geode git commit: Add source for geode c++ and .net clients
Date Thu, 19 May 2016 15:14:29 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/runcpp.sh
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/runcpp.sh b/geode-client-native/quickstart/runcpp.sh
new file mode 100755
index 0000000..98ba9ee
--- /dev/null
+++ b/geode-client-native/quickstart/runcpp.sh
@@ -0,0 +1,232 @@
+#!/bin/bash
+
+if [ -z ${GFCPP:-} ]; then
+  echo GFCPP is not set.
+  exit 1
+fi
+if [ -z ${GEMFIRE:-} ]; then
+  echo GEMFIRE is not set.
+  exit 1
+fi
+if [ -z ${OPENSSL:-} ]; then
+  echo Warning: OPENSSL is not set.
+  echo If OpenSSL libraries are not found in default library search path then Security example will fail.
+  echo
+  echo Press Enter to continue
+  read resp
+fi
+
+exname='invalidoption'
+
+if [ -f cpp/$1 ]
+then
+  exname=$1
+else
+  echo Please select a GemFire C++ QuickStart example to run.
+  echo
+  echo 1. BasicOperations
+  echo 2. DataExpiration
+  echo 3. LoaderListenerWriter
+  echo 4. RegisterInterest
+  echo 5. RemoteQuery
+  echo 6. HA Cache
+  echo 7. Exceptions
+  echo 8. DurableClient
+  echo 9. Security
+  echo 10.PutAllGetAllOperations
+  echo 11.Continuous Query
+  echo 12.Execute Functions
+  echo 13.DistributedSystem
+  echo 14.PoolWithEndpoints
+  echo 15.PoolRemoteQuery
+  echo 16.Pool Continuous Query
+  echo 17.Delta
+  echo 18.Multiuser Security
+  echo 19.RefIDExample
+  echo 20.Transactions
+  echo 21.TransactionsXA
+  echo 22.PdxRemoteQuery
+  echo 23.PdxSerializer
+  echo 24.PdxInstance
+  echo 25.PdxAutoSerializer
+  echo 26.Quit
+  echo
+
+  while [ "${exname}" == "invalidoption" ]
+  do
+    read -p "Enter option: " option
+    case "${option}" in
+      "1")
+        exname='BasicOperations'
+      ;;
+      "2")
+        exname='DataExpiration'
+      ;;
+      "3")
+        exname='LoaderListenerWriter'
+      ;;
+      "4")
+        exname='RegisterInterest'
+      ;;
+      "5")
+        exname='RemoteQuery'
+      ;;
+      "6")
+        exname='HACache'
+      ;;
+      "7")
+        exname='Exceptions'
+      ;;
+      "8")
+        exname='DurableClient'
+      ;;
+      "9")
+        exname='Security'
+      ;;
+      "10")
+        exname='PutAllGetAllOperations'
+      ;;  
+      "11")
+        exname='CqQuery'
+      ;;
+      "12")
+              exname='ExecuteFunctions'
+      ;;
+      "13")
+        exname='DistributedSystem'
+      ;;
+      "14")
+        exname='PoolWithEndpoints'
+      ;;  
+      "15")
+        exname='PoolRemoteQuery'
+      ;;
+      "16")
+        exname='PoolCqQuery'
+      ;;
+      "17")
+        exname='Delta'
+      ;;
+      "18")
+        exname='MultiuserSecurity'
+      ;;
+	  "19")
+        exname='RefIDExample'
+      ;;
+	  "20")
+        exname='Transactions'
+		;;
+          "21")
+        exname='TransactionsXA'
+                ;;
+	  "22")
+        exname='PdxRemoteQuery'
+		;;
+	  "23")
+        exname='PdxSerializer'
+		;;
+	  "24")
+        exname='PdxInstance'
+      ;;
+	  "25")
+        exname='PdxAutoSerializer'
+      ;;
+      "26")
+        exname='Quit'
+	exit
+      ;;
+    esac
+  done  
+fi
+
+echo Running GemFire C++ QuickStart example ${exname} ...
+
+export CLASSPATH="${CLASSPATH}:../lib/javaobject.jar:${GEMFIRE}/lib/gfSecurityImpl.jar"
+export PATH="${PATH}:${GEMFIRE}/bin"
+
+if [ ! -d gfecs ]
+then
+  mkdir gfecs
+fi
+
+
+if [ "${exname}" != "Security" ]
+  then
+    if [ "${exname}" != "MultiuserSecurity" ]
+      then
+        if [[ "${exname}" != "PoolRemoteQuery" && "${exname}" != "Delta" ]]
+          then
+            cacheserver start cache-xml-file=../XMLs/server${exname}.xml mcast-port=35673 -dir=gfecs
+        else
+          gemfire start-locator -port=34756 -dir=gfecs 
+          cacheserver start cache-xml-file=../XMLs/server${exname}.xml mcast-port=0 -dir=gfecs locators=localhost:34756
+        fi
+    else
+      cacheserver start cache-xml-file=../XMLs/server${exname}.xml mcast-port=35673 -dir=gfecs security-client-authenticator=templates.security.DummyAuthenticator.create security-authz-xml-uri=../XMLs/authz-dummy.xml security-client-accessor=templates.security.XmlAuthorization.create
+  fi
+else
+   cacheserver start cache-xml-file=../XMLs/server${exname}.xml mcast-port=35673 -dir=gfecs security-client-authenticator=templates.security.PKCSAuthenticator.create security-publickey-filepath=../keystore/publickeyfile security-publickey-pass=gemfire security-authz-xml-uri=../XMLs/authz-pkcs.xml security-client-accessor=templates.security.XmlAuthorization.create
+fi
+
+if [ "${exname}" == "DistributedSystem" ]
+then
+  if [ ! -d gfecs2 ]
+  then
+    mkdir gfecs2
+  fi
+  cacheserver start cache-xml-file=../XMLs/server${exname}2.xml mcast-port=35674 -dir=gfecs2
+fi
+
+
+if [ "${exname}" == "HACache"  ]
+then
+  if [ ! -d gfecs2 ]
+  then
+    mkdir gfecs2
+  fi
+  cacheserver start cache-xml-file=../XMLs/server${exname}2.xml mcast-port=35673 -dir=gfecs2
+fi
+
+if [ "${exname}" == "ExecuteFunctions" ]
+then
+  if [ ! -d gfecs2 ]
+  then
+    mkdir gfecs2
+  fi
+  cacheserver start cache-xml-file=../XMLs/server${exname}2.xml mcast-port=35673 -dir=gfecs2
+fi
+success=0
+if [ "${exname}" != "Security" ]
+then
+  export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${OPENSSL}/lib
+else
+  echo "starting client security less"
+fi
+
+$DEBUGGER cpp/${exname}
+success=$?
+
+cacheserver stop -dir=gfecs
+
+if [[ "${exname}" == "PoolRemoteQuery" || "${exname}" == "Delta" ]]
+   then
+    gemfire stop-locator -port=34756 -dir=gfecs
+fi
+
+if [ "${exname}" == "HACache" -o "${exname}" == "DistributedSystem" ]
+then
+  echo CacheServer 2 stopped
+  cacheserver stop -dir=gfecs2
+fi
+
+if [ "${exname}" == "ExecuteFunctions" ]
+then
+  cacheserver stop -dir=gfecs2
+fi
+
+if [ $success -ne "0" ]; then
+  exit 1
+fi
+
+echo Finished example ${exname}.
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/runcs.bat
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/runcs.bat b/geode-client-native/quickstart/runcs.bat
new file mode 100644
index 0000000..187f58c
--- /dev/null
+++ b/geode-client-native/quickstart/runcs.bat
@@ -0,0 +1,264 @@
+@echo off
+
+rem GFCPP must be set
+rem GEMFIRE must be set
+rem OPENSSL must be set for Security example
+
+if not "%GFCPP%"=="" goto checkGEMFIRE
+
+echo GFCPP is not set.
+goto finished
+
+:checkGEMFIRE
+
+if not "%GEMFIRE%"=="" goto checkOPENSSL
+
+echo GEMFIRE is not set.
+goto finished
+
+:checkOPENSSL
+
+if not "%OPENSSL%"=="" goto startexamples
+
+echo OPENSSL is not set.
+echo If OpenSSL libraries are not found in PATH then Security example will fail.
+
+
+:startexamples
+
+mkdir ..\bin
+copy /V %GFCPP%\bin\GemStone.GemFire.Cache.dll ..\bin\.
+
+set LANG=C#
+set LANGDIR=csharp
+
+if not exist %LANGDIR%\%1.exe goto presentmenu
+
+set exname=%1
+
+:runexample
+
+if not exist %LANGDIR%\%exname%.exe goto presentmenu
+
+echo.
+echo Running GemFire %LANG% QuickStart example %exname% ...
+
+set CLASSPATH=%CLASSPATH%;../lib/javaobject.jar;%GEMFIRE%\lib\gfSecurityImpl.jar
+set PATH=%GEMFIRE%\bin;%PATH%;%GEMFIRE%\bin;%GFCPP%\bin;%OPENSSL%\bin;..\bin;
+
+if not exist gfecs mkdir gfecs
+
+if '%exname%' neq 'Delta' goto notwithlocator
+
+echo locator start
+
+call gemfire start-locator -port=34756 -dir=gfecs
+
+:notwithlocator
+
+if '%exname%' neq 'PoolRemoteQuery' goto skiplocatorstart
+
+echo locator start
+
+call gemfire start-locator -port=34756 -dir=gfecs
+
+:skiplocatorstart
+
+if '%exname%' neq 'HACache' goto skiphadir
+
+if not exist gfecs2 mkdir gfecs2
+
+:skiphadir
+
+if '%exname%' neq 'ExecuteFunctions' goto skipfuncdir
+
+if not exist gfecs2 mkdir gfecs2
+
+:skipfuncdir
+
+if '%exname%' equ 'PoolRemoteQuery' goto startserverwithlocator
+
+if '%exname%' equ 'Delta' goto startserverwithlocator
+
+if '%exname%' equ 'Security' goto startserverforsecurity
+
+if '%exname%' equ 'MultiuserSecurity' goto startserverformultiusersecurity
+
+call cacheserver start cache-xml-file=../XMLs/server%exname%.xml mcast-port=35673 -dir=gfecs
+
+echo cacheServer started
+
+if '%exname%' neq 'HACache' goto skiphastart
+
+call cacheserver start cache-xml-file=../XMLs/server%exname%2.xml mcast-port=35673 -dir=gfecs2
+
+echo cacheServer2 started
+
+:skiphastart
+
+if '%exname%' neq 'ExecuteFunctions' goto skipfuncstart
+
+call cacheserver start cache-xml-file=../XMLs/server%exname%2.xml mcast-port=35673 -dir=gfecs2
+
+echo cacheServer2 started
+
+:skipfuncstart
+
+if '%exname%' neq 'Security' goto :skipsecuritystart 
+
+if '%exname%' neq 'MultiuserSecurity' goto :skipsecuritystart 
+
+:startserverforsecurity
+
+call cacheserver start cache-xml-file=../XMLs/server%exname%.xml mcast-port=35673 -dir=gfecs security-client-authenticator=templates.security.DummyAuthenticator.create security-authz-xml-uri=../XMLs/authz-dummy.xml security-client-accessor=templates.security.XmlAuthorization.create security-client-auth-init=templates.security.UserPasswordAuthInit.create
+
+if '%exname%' neq 'MultiuserSecurity' goto :skipsecuritystart 
+:startserverformultiusersecurity
+call cacheserver start cache-xml-file=../XMLs/server%exname%.xml mcast-port=35673 -dir=gfecs security-client-authenticator=templates.security.DummyAuthenticator.create security-authz-xml-uri=../XMLs/authz-dummy.xml security-client-accessor=templates.security.XmlAuthorization.create
+
+goto :skipsecuritystart
+
+:startserverwithlocator
+
+call cacheserver start cache-xml-file=../XMLs/server%exname%.xml mcast-port=0 -dir=gfecs locators=localhost:34756  
+
+:skipsecuritystart
+
+if '%exname%' neq 'PoolRemoteQuery' goto notstartedserverwithlocator
+
+:notstartedserverwithlocator
+
+if '%exname%' neq 'DistributedSystem' goto skipDSstart
+
+if not exist gfecs2 mkdir gfecs2
+
+call cacheserver start cache-xml-file=../XMLs/server%exname%2.xml mcast-port=35674 -dir=gfecs2
+
+:skipDSstart
+
+call %LANGDIR%\%exname%.exe
+if not "%errorlevel%"=="0" (
+call cacheserver stop -dir=gfecs
+call cacheserver stop -dir=gfecs2
+exit %errorlevel% 
+)
+call cacheserver stop -dir=gfecs
+
+if '%exname%' neq 'HACache' goto skiphastop
+
+call cacheserver stop -dir=gfecs2
+
+:skiphastop
+
+if '%exname%' neq 'ExecuteFunctions' goto skipfuncstop
+
+call cacheserver stop -dir=gfecs2
+
+:skipfuncstop
+
+if '%exname%' neq 'PoolRemoteQuery' goto skiplocatorstop1
+
+call gemfire stop-locator -port=34756 -dir=gfecs
+
+:skiplocatorstop1
+
+if '%exname%' neq 'Delta' goto skiplocatorstop2
+
+call gemfire stop-locator -port=34756 -dir=gfecs
+
+:skiplocatorstop2
+
+if '%exname%' neq 'DistributedSystem' goto skipDSstop
+
+call cacheserver stop -dir=gfecs2
+
+:skipDSstop
+
+if '%exname%' equ 'invalidoption' goto invalidoption
+
+rem echo Please review the example's log output above then
+
+rem pause
+
+goto closeup
+
+:presentmenu
+
+echo.
+echo Please select a GemFire %LANG% QuickStart example to run.
+echo.
+echo 1. BasicOperations
+echo 2. DataExpiration
+echo 3. LoaderListenerWriter
+echo 4. RegisterInterest
+echo 5. RemoteQuery
+echo 6. HA Cache
+echo 7. Exceptions
+echo 8. DurableClient
+echo 9. Security
+echo 10.PutAllGetAllOperations
+echo 11.Continuous Query
+echo 12.DistributedSystem
+echo 13.PoolWithEndpoints
+echo 14.PoolRemoteQuery
+echo 15.ExecuteFunctions
+echo 16.Pool Continuous Query
+echo 17.Delta
+echo 18.MultiuserSecurity
+echo 19.RefIDExample
+echo 20.Transactions
+echo 21.PdxRemoteQuery 
+echo 22.PdxSerializer 
+echo 23.PdxInstance 
+echo 24.Quit
+echo.
+
+:getoption
+
+rem choice /c:123 /n
+
+set /p option=Enter option: 
+
+set exname=invalidoption
+
+if '%option%' equ '1' set exname=BasicOperations
+if '%option%' equ '2' set exname=DataExpiration
+if '%option%' equ '3' set exname=LoaderListenerWriter
+if '%option%' equ '4' set exname=RegisterInterest
+if '%option%' equ '5' set exname=RemoteQuery
+if '%option%' equ '6' set exname=HACache
+if '%option%' equ '7' set exname=Exceptions
+if '%option%' equ '8' set exname=DurableClient
+if '%option%' equ '9' set exname=Security
+if '%option%' equ '10' set exname=PutAllGetAllOperations
+if '%option%' equ '11' set exname=CqQuery
+if '%option%' equ '12' set exname=DistributedSystem
+if '%option%' equ '13' set exname=PoolWithEndpoints
+if '%option%' equ '14' set exname=PoolRemoteQuery
+if '%option%' equ '15' set exname=ExecuteFunctions
+if '%option%' equ '16' set exname=PoolCqQuery
+if '%option%' equ '17' set exname=Delta
+if '%option%' equ '18' set exname=MultiuserSecurity
+if '%option%' equ '19' set exname=RefIDExample
+if '%option%' equ '20' set exname=Transactions
+if '%option%' equ '21' set exname=PdxRemoteQuery
+if '%option%' equ '22' set exname=PdxSerializer
+if '%option%' equ '23' set exname=PdxInstance
+if '%option%' equ '24' goto finished
+
+if '%exname%' equ 'invalidoption' goto invalidoption
+
+goto runexample
+
+:invalidoption
+
+echo Invalid option.
+goto getoption
+
+:closeup
+
+rmdir /Q /S ..\bin
+
+echo Finished example %exname%.
+
+:finished

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/runinterop.bat
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/runinterop.bat b/geode-client-native/quickstart/runinterop.bat
new file mode 100644
index 0000000..e955cc1
--- /dev/null
+++ b/geode-client-native/quickstart/runinterop.bat
@@ -0,0 +1,40 @@
+@echo off
+
+if not exist interop\InteropCPP.exe goto notexist
+if not exist interop\InteropCSHARP.exe goto notexist
+if not exist interop\InteropJAVA.class goto notexist
+
+echo.
+echo Running GemFire QuickStart Interop example ...
+
+set CLASSPATH=%GEMFIRE%\lib\gemfire.jar;./interop
+
+if not exist gfecs mkdir gfecs
+
+call cacheserver start cache-xml-file=../XMLs/serverInterop.xml -dir=gfecs
+
+start /b interop\InteropCPP.exe checkcsharp
+
+start /b interop\InteropCSHARP.exe
+
+start /b java InteropJAVA checkcsharp
+
+rem call cacheserver stop -dir=gfecs
+
+rem echo Please review the example's log output above then
+
+rem pause
+
+goto closeup
+
+:notexist
+
+echo.
+echo Interop example not found, please check whether it is built.
+echo.
+
+:closeup
+
+echo Finished Interop example.
+
+:finished

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/quickstart/runinterop.sh
----------------------------------------------------------------------
diff --git a/geode-client-native/quickstart/runinterop.sh b/geode-client-native/quickstart/runinterop.sh
new file mode 100755
index 0000000..3ec1c0d
--- /dev/null
+++ b/geode-client-native/quickstart/runinterop.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+if [ ! -f interop/InteropCPP ]
+then
+  echo Interop CPP example not found, please check whether it is built.
+  exit 1
+fi
+
+if [ ! -f interop/InteropJAVA.class ]
+then
+  echo Interop Java example not found, please check whether it is built.
+  exit 1
+fi
+
+echo Running GemFire QuickStart Interop example ...
+
+export CLASSPATH="${GEMFIRE}/lib/gemfire.jar:./interop"
+export PATH="${PATH}:${GEMFIRE}/bin"
+
+if [ ! -d gfecs ]
+then
+  mkdir gfecs
+fi
+
+cacheserver start cache-xml-file=../XMLs/serverInterop.xml mcast-port=35673 -dir=gfecs
+
+interop/InteropCPP &
+
+java InteropJAVA &
+
+# cacheserver stop -dir=gfecs
+
+echo Finished Interop example.
+
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/sdk/build-src.xml
----------------------------------------------------------------------
diff --git a/geode-client-native/sdk/build-src.xml b/geode-client-native/sdk/build-src.xml
new file mode 100644
index 0000000..8136a59
--- /dev/null
+++ b/geode-client-native/sdk/build-src.xml
@@ -0,0 +1,154 @@
+
+<!-- An XML include file that contains common Ant target for building
+     source code -->
+
+  <target name="usage"
+          description="Describes how to find out usage information">
+    <echo>
+Builds artifacts developed with the GemFire SDK.
+
+Run "build.sh -projecthelp" for descriptions of available build
+targets.
+    </echo>
+  </target>
+
+  <taskdef classname="com.gemstone.tools.ant.taskdefs.Conditional"
+           name="conditional"> 
+    <classpath>
+      <pathelement location="${basedir}/product/taskdefsV3.jar"/>
+    </classpath>
+  </taskdef>
+
+  <target name="-props">
+    <!-- "Sets Ant properties for this Project" -->
+
+    <property environment="myenv"/>  <!-- Get environment variables -->
+
+    <!-- determine machine and os -->
+    <condition property="gf.os" value="sol">
+      <os name="SunOs"/>
+    </condition>
+    <condition property="gf.os" value="linux">
+      <os name="Linux"/>
+    </condition>
+    <condition property="gf.os" value="win">
+      <os family="windows"/>
+    </condition>
+
+    <!-- Load Ant property files, if present -->
+    <property file="${basedir}/build${gf.os}.properties"/>
+    <available file="${basedir}/build${gf.os}.properties" 
+               property="build.os.exists"/>
+    <conditional if="build.os.exists">
+      <echo message="Loading properties from ${basedir}/build${gf.os}.properties:"/>
+      <concat>
+        <filelist dir="${basedir}" files="build${gf.os}.properties"/>
+      </concat>
+    </conditional>
+
+    <property file="${basedir}/build.properties"/>
+    <available file="${basedir}/build.properties" property="build.props.exists"/>
+    <conditional if="build.props.exists">
+      <echo message="Loading properties from ${basedir}/build.properties:"/>
+      <concat>
+        <filelist dir="${basedir}" files="build.properties"/>
+      </concat>
+    </conditional>
+
+    <property name="build.dir" value="${basedir}/build-artifacts"/>
+    <property name="osbuild.dir" value="${build.dir}/${gf.os}"/>
+    <property name="gemfire.product" 
+              value="${basedir}/product/${gf.os}"/>
+
+    <property name="src.dir" value="${basedir}/src"/>
+    <patternset id="src.files">
+      <include name="com/gemstone/**/*.java"/>
+    </patternset>
+
+    <path id="src.compile.classpath">
+      <pathelement location="${gemfire.product}/lib/gemfire.jar"/>
+      <fileset dir="${src.dir}/lib">
+        <include name="*.jar"/>
+      </fileset>
+    </path>
+    <property name="classes.dir" value="${osbuild.dir}/classes"/>
+
+    <property name="tests.src.dir" value="${basedir}/tests"/>
+    <path id="tests.compile.classpath">
+      <path refid="src.compile.classpath"/>
+      <pathelement location="${classes.dir}"/>      
+      <pathelement location="${tests.src.dir}/lib/test-framework.jar"/>      
+      <pathelement location="${tests.src.dir}/lib/test-framework.jar"/>
+      <fileset dir="${tests.src.dir}/lib">
+        <include name="*.jar"/>
+      </fileset>
+    </path>
+    <property name="tests.classes.dir"
+              value="${osbuild.dir}/tests/classes"/> 
+
+    <property name="last.update.file" value="lastUpdate.txt"/>
+    <property name="jar.name" value="gfApp.jar"/>
+    <property name="app.version" value="1.0alpha"/>
+    <property name="jar.manifest" value="${osbuild.dir}/Manifest.mf"/>
+    <property name="date.pattern" value="MM/dd/yyyy HH:mm:ss z"/>
+    <tstamp>
+       <format pattern="${date.pattern}" property="build.time"/>
+    </tstamp>
+    <property name="product.dir" value="${osbuild.dir}/product"/>
+
+  </target>
+
+  <target name="-compile-java-source">
+    <!-- Does the real work of compiling the Java source code -->
+
+    <mkdir dir="${classes.dir}"/>
+
+    <property name="includeAntRuntime" value="false"/>
+    <property name="deprecation" value="on"/>
+ 
+    <javac debug="on" optimize="off" deprecation="${deprecation}" 
+           verbose="off" nowarn="off"
+           includeAntRuntime="${includeAntRuntime}" 
+           srcdir="${src.dir}"
+           destdir="${classes.dir}">
+      <patternset refid="src.files"/>
+      <classpath refid="src.compile.classpath"/>
+    </javac>
+  </target>
+
+  <target name="update-cvs" depends="-props"
+          description="Updates this CVS checkout and notes the time">
+    <property name="cvs.logfile" value="update-cvs.log"/>
+    <tstamp>
+      <format pattern="${date.pattern}" property="last.update"/>
+    </tstamp>
+    <mkdir dir="${build.dir}"/>
+    <echo file="${build.dir}/${last.update.file}">Source-Date: ${last.update}
+</echo>
+    <propertyfile comment="Build Number File" file="${build.dir}/build.number">
+      <entry default="0" key="build.number" operation="+" type="int"/>
+    </propertyfile>
+
+    <property name="cvs.hist.logfile" value=".cvs-history.log"/>
+    <delete file="${cvs.logfile}" quiet="true"/>
+
+<!--<property name="cvs.command" value="update -dP ${cvs.branch}"/>-->
+    <property name="cvs.command" value="update -dP -A"/>
+    <echo message="Invoking &apos;${cvs.command}&apos; logging to ${cvs.logfile}"/>
+    <cvs append="true" command="${cvs.command}" error="${cvs.logfile}" failonerror="true" output="${cvs.logfile}" quiet="true"/>
+    <exec executable="grep" resultproperty="grepExitStatus">
+      <arg value="^C "/>
+      <arg value="${cvs.logfile}"/>
+    </exec>
+    <condition property="grepFailed">
+      <equals arg1="${grepExitStatus}" arg2="0"/>
+    </condition>
+    <fail if="grepFailed" message="CVS conflicts detected"/>
+
+    <concat append="true" destfile="${cvs.hist.logfile}">==================</concat>
+    <concat append="true" destfile="${cvs.hist.logfile}">
+      <filelist dir="${basedir}" files="build-artifacts/build.number"/>
+      <filelist dir="${basedir}" files="${cvs.logfile}"/>
+    </concat>
+  </target>
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/BUILDING.md
----------------------------------------------------------------------
diff --git a/geode-client-native/src/BUILDING.md b/geode-client-native/src/BUILDING.md
new file mode 100644
index 0000000..ffe263a
--- /dev/null
+++ b/geode-client-native/src/BUILDING.md
@@ -0,0 +1,68 @@
+# Supported Platforms
+* [Mac OS X](#mac-os-x)
+* [Windows](#windows)
+* [Linux](#linux)
+* [Solaris](#solaris)
+
+# Common Tools
+## Required Tools
+* [CMake 4.3](https://cmake.org/) or newer
+* C++11 compiler *(see platform specific requirements)*
+
+## Optional Tools
+* [Doxygen 8.11](http://www.stack.nl/~dimitri/doxygen/download.html) *(If building source documentation)*
+
+
+
+# Mac OS X
+* Mac OS X 10.11 (El Capitan)
+
+## Required Tools
+* [XCode](https://developer.apple.com/xcode/download/)
+* XCode Command Line Developer Tools
+   `$ xcode-select --install` 
+
+## Alternative Tools
+* [CMake GUI](https://cmake.org/files/v3.4/cmake-3.4.3-Darwin-x86_64.dmg)
+* [Doxygen GUI](http://ftp.stack.nl/pub/users/dimitri/Doxygen-1.8.11.dmg)
+
+## Optional Tools
+* [Eclipse CDT 8.8+](https://eclipse.org/cdt/)
+
+
+
+# Windows
+* Windows 8.1 64-bit
+* Windows 10 64-bit
+* Windows Server 2012 64-bit
+* Windows Server 2012 R2 64-bit
+
+## Required Tools
+* [Visual Studio 2013](https://www.visualstudio.com) or newer
+* Cygwin
+
+
+
+# Linux
+* RHEL/CentOS 6
+* RHEL/CentOS 7
+* SLES 11
+* SLES 12
+
+## Required Tools
+* GCC 4.6 or newer
+
+## Optional Tools
+* [Eclipse CDT 8.8+](https://eclipse.org/cdt/)
+
+
+
+# Solaris
+* Solaris 10 SPARC
+* Solaris 10 x86
+* Solaris 11 SPARC
+* Solaris 11 x86
+
+### Required Tools
+* [Solaris Studion 12.4](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-141149.html) or newer
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/geode-client-native/src/CMakeLists.txt b/geode-client-native/src/CMakeLists.txt
new file mode 100644
index 0000000..ca4a090
--- /dev/null
+++ b/geode-client-native/src/CMakeLists.txt
@@ -0,0 +1,84 @@
+cmake_minimum_required(VERSION 3.4)
+project(nativeclient)
+
+set(CMAKE_CONFIGURATION_TYPES Debug Release)
+if (NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE Debug)
+endif()
+
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
+# TODO this doesn't seem to have effect
+set(CMAKE_ECLIPSE_VERSION Mars)
+
+#TODO this check is failing to fail properly on solaris with sun CC 5.10
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+include(CheckCXXCompilerFlag)
+include(CheckCCompilerFlag)
+
+set(CMAKE_REQUIRED_LIBRARIES -m64)
+check_c_compiler_flag(-m64 CFLAGS_M64_ALLOWED)
+check_cxx_compiler_flag(-m64 CXXFLAGS_M64_ALLOWED)
+set(CMAKE_REQUIRED_LIBRARIES)
+
+check_c_compiler_flag(-mt CFLAGS_mt_ALLOWED)
+
+if (CFLAGS_M64_ALLOWED AND CXXFLAGS_M64_ALLOWED)
+  set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -m64)
+  add_compile_options(-m64)
+#TODO cmake find better way to set linker flags
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64")
+  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -m64")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64")
+endif()
+
+if (CFLAGS_mt_ALLOWED)
+  set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -mt)
+  add_compile_options(-mt)
+endif()
+
+#TODO remove this debugging for NMake
+set(CMAKE_VERBOSE_MAKEFILE 0)
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
+  # Force linker to error on undefined symbols in shared libraries
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z defs")
+  # TODO cmake find a better way to set runtime libraries
+  # C++11 requires these libraries, treat -std=c++11 as library
+  #TODO look into CMAKE_CXX_STANDARD_LIBRARIES
+  set(RUNTIME_LIBRARIES ${RUNTIME_LIBRARIES} -std=c++11 stdc++ gcc_s CrunG3 c)
+elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
+endif()
+if(MSVC)
+    # TODO error on warnings
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+  set(BUILD_CLI 1)
+endif()
+
+find_package(Java 1.8.0.60 REQUIRED COMPONENTS Development)
+
+if ("${CMAKE_AR}" STREQUAL "CMAKE_AR-NOTFOUND")
+  message(FATAL_ERROR "Utility ar not found.")
+endif()
+
+set(GEMFIRE_HOME "" CACHE PATH "Path to GemFire production installation.")
+
+add_subdirectory(dependencies)
+add_subdirectory(cppcache)
+add_subdirectory(cryptoimpl)
+add_subdirectory(dhimpl)
+add_subdirectory(sqliteimpl)
+add_subdirectory(gfcpp)
+add_subdirectory(pdxautoserializer)
+add_subdirectory(tests)
+add_subdirectory(templates/security)
+
+
+if (${BUILD_CLI})
+  add_subdirectory(clicache)
+  add_subdirectory(plugins/SQLiteCLI)
+endif()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/FindNativeClient.cmake
----------------------------------------------------------------------
diff --git a/geode-client-native/src/FindNativeClient.cmake b/geode-client-native/src/FindNativeClient.cmake
new file mode 100755
index 0000000..bece031
--- /dev/null
+++ b/geode-client-native/src/FindNativeClient.cmake
@@ -0,0 +1,277 @@
+#.rst:
+# FindJava
+# --------
+#
+# Find Java
+#
+# This module finds if Java is installed and determines where the
+# include files and libraries are.  The caller may set variable JAVA_HOME
+# to specify a Java installation prefix explicitly.
+#
+#
+# Specify one or more of the following components as you call this find module. See example below.
+#
+# ::
+#
+#   Runtime     = User just want to execute some Java byte-compiled
+#   Development = Development tools (java, javac, javah and javadoc), includes Runtime component
+#   IdlJ        = idl compiler for Java
+#   JarSigner   = signer tool for jar
+#
+#
+# This module sets the following result variables:
+#
+# ::
+#
+#   Java_JAVA_EXECUTABLE      = the full path to the Java runtime
+#   Java_JAVAC_EXECUTABLE     = the full path to the Java compiler
+#   Java_JAVAH_EXECUTABLE     = the full path to the Java header generator
+#   Java_JAVADOC_EXECUTABLE   = the full path to the Java documention generator
+#   Java_IDLJ_EXECUTABLE      = the full path to the Java idl compiler
+#   Java_JAR_EXECUTABLE       = the full path to the Java archiver
+#   Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
+#   Java_VERSION_STRING       = Version of java found, eg. 1.6.0_12
+#   Java_VERSION_MAJOR        = The major version of the package found.
+#   Java_VERSION_MINOR        = The minor version of the package found.
+#   Java_VERSION_PATCH        = The patch version of the package found.
+#   Java_VERSION_TWEAK        = The tweak version of the package found (after '_')
+#   Java_VERSION              = This is set to: $major.$minor.$patch(.$tweak)
+#
+#
+#
+# The minimum required version of Java can be specified using the
+# standard CMake syntax, e.g.  find_package(Java 1.5)
+#
+# NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to
+# be identical.  For example some java version may return:
+# Java_VERSION_STRING = 1.5.0_17 and Java_VERSION = 1.5.0.17
+#
+# another example is the Java OEM, with: Java_VERSION_STRING = 1.6.0-oem
+# and Java_VERSION = 1.6.0
+#
+# For these components the following variables are set:
+#
+# ::
+#
+#   Java_FOUND                    - TRUE if all components are found.
+#   Java_INCLUDE_DIRS             - Full paths to all include dirs.
+#   Java_LIBRARIES                - Full paths to all libraries.
+#   Java_<component>_FOUND        - TRUE if <component> is found.
+#
+#
+#
+# Example Usages:
+#
+# ::
+#
+#   find_package(Java)
+#   find_package(Java COMPONENTS Runtime)
+#   find_package(Java COMPONENTS Development)
+
+#=============================================================================
+# Copyright 2002-2009 Kitware, Inc.
+# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
+
+# The HINTS option should only be used for values computed from the system.
+set(_JAVA_HINTS)
+if(_JAVA_HOME)
+  list(APPEND _JAVA_HINTS ${_JAVA_HOME}/bin)
+endif()
+list(APPEND _JAVA_HINTS
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/bin"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/bin"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin"
+  )
+# Hard-coded guesses should still go in PATHS. This ensures that the user
+# environment can always override hard guesses.
+set(_JAVA_PATHS
+  /usr/lib/java/bin
+  /usr/share/java/bin
+  /usr/local/java/bin
+  /usr/local/java/share/bin
+  /usr/java/j2sdk1.4.2_04
+  /usr/lib/j2sdk1.4-sun/bin
+  /usr/java/j2sdk1.4.2_09/bin
+  /usr/lib/j2sdk1.5-sun/bin
+  /opt/sun-jdk-1.5.0.04/bin
+  /usr/local/jdk-1.7.0/bin
+  /usr/local/jdk-1.6.0/bin
+  )
+find_program(Java_JAVA_EXECUTABLE
+  NAMES java
+  HINTS ${_JAVA_HINTS}
+  PATHS ${_JAVA_PATHS}
+)
+
+if(Java_JAVA_EXECUTABLE)
+    execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -version
+      RESULT_VARIABLE res
+      OUTPUT_VARIABLE var
+      ERROR_VARIABLE var # sun-java output to stderr
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      ERROR_STRIP_TRAILING_WHITESPACE)
+    if( res )
+      if(var MATCHES "No Java runtime present, requesting install")
+        set_property(CACHE Java_JAVA_EXECUTABLE
+          PROPERTY VALUE "Java_JAVA_EXECUTABLE-NOTFOUND")
+      elseif(${Java_FIND_REQUIRED})
+        message( FATAL_ERROR "Error executing java -version" )
+      else()
+        message( STATUS "Warning, could not run java -version")
+      endif()
+    else()
+      # extract major/minor version and patch level from "java -version" output
+      # Tested on linux using
+      # 1. Sun / Sun OEM
+      # 2. OpenJDK 1.6
+      # 3. GCJ 1.5
+      # 4. Kaffe 1.4.2
+      # 5. OpenJDK 1.7.x on OpenBSD
+      if(var MATCHES "java version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\"")
+        # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
+        set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
+      elseif(var MATCHES "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+)\"")
+        # Kaffe style
+        set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
+      elseif(var MATCHES "openjdk version \"([0-9]+\\.[0-9]+\\.[0-9_]+.*)\"")
+        # OpenJDK ver 1.7.x on OpenBSD
+        set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
+      else()
+        if(NOT Java_FIND_QUIETLY)
+          message(WARNING "regex not supported: ${var}. Please report")
+        endif()
+      endif()
+      string( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
+      string( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
+      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
+      # warning tweak version can be empty:
+      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
+      if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
+        set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
+      else()
+        set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK})
+      endif()
+    endif()
+
+endif()
+
+
+find_program(Java_JAR_EXECUTABLE
+  NAMES jar
+  HINTS ${_JAVA_HINTS}
+  PATHS ${_JAVA_PATHS}
+)
+
+find_program(Java_JAVAC_EXECUTABLE
+  NAMES javac
+  HINTS ${_JAVA_HINTS}
+  PATHS ${_JAVA_PATHS}
+)
+
+find_program(Java_JAVAH_EXECUTABLE
+  NAMES javah
+  HINTS ${_JAVA_HINTS}
+  PATHS ${_JAVA_PATHS}
+)
+
+find_program(Java_JAVADOC_EXECUTABLE
+  NAMES javadoc
+  HINTS ${_JAVA_HINTS}
+  PATHS ${_JAVA_PATHS}
+)
+
+find_program(Java_IDLJ_EXECUTABLE
+  NAMES idlj
+  HINTS ${_JAVA_HINTS}
+  PATHS ${_JAVA_PATHS}
+)
+
+find_program(Java_JARSIGNER_EXECUTABLE
+  NAMES jarsigner
+  HINTS ${_JAVA_HINTS}
+  PATHS ${_JAVA_PATHS}
+)
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+if(Java_FIND_COMPONENTS)
+  set(_JAVA_REQUIRED_VARS)
+  foreach(component ${Java_FIND_COMPONENTS})
+    # User just want to execute some Java byte-compiled
+    If(component STREQUAL "Runtime")
+      list(APPEND _JAVA_REQUIRED_VARS Java_JAVA_EXECUTABLE)
+      if(Java_JAVA_EXECUTABLE)
+        set(Java_Runtime_FOUND TRUE)
+      endif()
+    elseif(component STREQUAL "Development")
+      list(APPEND _JAVA_REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAVAC_EXECUTABLE
+                                      Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
+      if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE
+          AND Java_JAVAH_EXECUTABLE AND Java_JAVADOC_EXECUTABLE)
+        set(Java_Development_FOUND TRUE)
+      endif()
+    elseif(component STREQUAL "IdlJ")
+      list(APPEND _JAVA_REQUIRED_VARS Java_IDLJ_EXECUTABLE)
+      if(Java_IdlJ_EXECUTABLE)
+        set(Java_Extra_FOUND TRUE)
+      endif()
+    elseif(component STREQUAL "JarSigner")
+      list(APPEND _JAVA_REQUIRED_VARS Java_JARSIGNER_EXECUTABLE)
+      if(Java_IDLJ_EXECUTABLE)
+        set(Java_JarSigner_FOUND TRUE)
+      endif()
+    else()
+      message(FATAL_ERROR "Comp: ${component} is not handled")
+    endif()
+  endforeach()
+  list (REMOVE_DUPLICATES _JAVA_REQUIRED_VARS)
+  find_package_handle_standard_args(Java
+    REQUIRED_VARS ${_JAVA_REQUIRED_VARS} HANDLE_COMPONENTS
+    VERSION_VAR Java_VERSION
+    )
+  if(Java_FOUND)
+    foreach(component ${Java_FIND_COMPONENTS})
+      set(Java_${component}_FOUND TRUE)
+    endforeach()
+  endif()
+else()
+  # Check for Development
+  find_package_handle_standard_args(Java
+    REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
+                  Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE
+    VERSION_VAR Java_VERSION
+    )
+endif()
+
+
+mark_as_advanced(
+  Java_JAVA_EXECUTABLE
+  Java_JAR_EXECUTABLE
+  Java_JAVAC_EXECUTABLE
+  Java_JAVAH_EXECUTABLE
+  Java_JAVADOC_EXECUTABLE
+  Java_IDLJ_EXECUTABLE
+  Java_JARSIGNER_EXECUTABLE
+  )
+
+# LEGACY
+set(JAVA_RUNTIME ${Java_JAVA_EXECUTABLE})
+set(JAVA_ARCHIVE ${Java_JAR_EXECUTABLE})
+set(JAVA_COMPILE ${Java_JAVAC_EXECUTABLE})
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/FindNativeClientCPPCache.cmake
----------------------------------------------------------------------
diff --git a/geode-client-native/src/FindNativeClientCPPCache.cmake b/geode-client-native/src/FindNativeClientCPPCache.cmake
new file mode 100755
index 0000000..ed63420
--- /dev/null
+++ b/geode-client-native/src/FindNativeClientCPPCache.cmake
@@ -0,0 +1,68 @@
+#.rst:
+# FindNativeClientCPPCache
+# ------------------------
+#
+# Try to find the NativeClient cppcache library
+#
+# Once done this will define
+#
+# ::
+#
+#   NATIVECLIENT_CPPCACHE_FOUND - true when cmake has found the NativeClient CPPCache library
+#   NATIVECLIENT_CPPCACHE_INCLUDE_DIR - The NativeClient include directory
+#   NATIVECLIENT_CPPCACHE_LIBRARIES - The libraries needed to use NativeClient CPPCache library
+#   NATIVECLIENT_CPPCACH_DEFINITIONS - Compiler switches required for using NativeClient CPPCache library
+#   NATIVECLIENT_CPPCACH_VERSION_STRING - the version of NativeClient CPPCache library found
+
+#=============================================================================
+# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (TODO: To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
+   HINTS
+   ${PC_LIBXML_INCLUDEDIR}
+   ${PC_LIBXML_INCLUDE_DIRS}
+   PATH_SUFFIXES libxml2
+   )
+
+find_library(LIBXML2_LIBRARIES NAMES xml2 libxml2
+   HINTS
+   ${PC_LIBXML_LIBDIR}
+   ${PC_LIBXML_LIBRARY_DIRS}
+   )
+
+find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint)
+
+set( NATIVECLIENT_CPPCACHE_VERSION_STRING "9.0" )
+set( NATIVECLIENT_CPPCACHE_FOUND "YES" )
+set( NATIVECLIENT_CPPCACHE_INCLUDE_DIR  ${CMAKE_CURRENT_BINARY_DIRECTORY}/include ) # TODO: Replace with install directory
+set( NATIVECLIENT_CPPCACHE_LIBRARIES  ${GTK_gtk_LIBRARY}
+                    ${GTK_gdk_LIBRARY}
+                    ${GTK_glib_LIBRARY} )
+elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
+    file(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
+         REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"")
+
+    string(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
+           LIBXML2_VERSION_STRING "${libxml2_version_str}")
+    unset(libxml2_version_str)
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
+# all listed variables are TRUE
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
+                                  REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
+                                  VERSION_VAR LIBXML2_VERSION_STRING)
+
+mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/bdbimpl/BDBHelper.cpp
----------------------------------------------------------------------
diff --git a/geode-client-native/src/bdbimpl/BDBHelper.cpp b/geode-client-native/src/bdbimpl/BDBHelper.cpp
new file mode 100644
index 0000000..59bdb7a
--- /dev/null
+++ b/geode-client-native/src/bdbimpl/BDBHelper.cpp
@@ -0,0 +1,196 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+#include "DBHelper.hpp"
+#include "ExceptionTypes.hpp"
+#include "db_cxx.h"
+#include "db.h"
+#include <stdlib.h>
+
+namespace gemfire {
+
+class BDBHelper : public DBHelper {
+
+  public:
+
+  void createEnvironment(std::string m_gEnvDirectory, size_t m_cacheSizeGb, size_t m_cacheSizeMb);
+
+  void* createNewDB(std::string regionDBFile);
+
+  void* createNewDBNoThrow(std::string regionDBFile);
+
+  void writeToDB(void *dbh,void *keyData,uint32_t keyBufferSize,void *valueData,uint32_t valueBufferSize);
+
+  void readFromDB(void *dbh,void *keyData,uint32_t keyBufferSize,void*& valueData,uint32_t& valueBufferSize);
+
+  void destroy(void *dbHandle,void *keyData,uint32_t keyBufferSize);
+  
+  void closeEnvironment();
+  
+  void closeDB(void *dbh);
+
+  private:
+
+  static DbEnv *m_gDbEnv;
+
+};
+
+DbEnv* BDBHelper::m_gDbEnv=NULL;
+
+void BDBHelper::createEnvironment(std::string m_gEnvDirectory, size_t m_cacheSizeGb, size_t m_cacheSizeMb)
+{
+  try {
+	m_gDbEnv = new DbEnv( 0 );
+	m_gDbEnv->set_alloc(::malloc, ::realloc, ::free);
+	LOGFINE("Cachesize setting..%d,%lu",m_cacheSizeGb,m_cacheSizeMb);
+        m_gDbEnv->set_cachesize(m_cacheSizeGb, m_cacheSizeMb, 0);
+        m_gDbEnv->open(m_gEnvDirectory.c_str(), DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL | DB_THREAD, 0);
+  }
+  catch (DbException &envException) {
+    char exceptionMsg[1024];
+    sprintf(exceptionMsg,"Failed to initialize environment: %s",envException.what());
+    LOGERROR("%s",exceptionMsg);
+    throw InitFailedException(exceptionMsg);
+  }
+}
+
+void* BDBHelper::createNewDBNoThrow(std::string regionDBFile)
+{
+  Db *dbHandle = new Db( m_gDbEnv, 0 );
+  dbHandle->set_alloc(::malloc, ::realloc, ::free);
+  try {
+    dbHandle->open(NULL, regionDBFile.c_str(), "region_db", DB_BTREE,  DB_CREATE | DB_THREAD, 0664);
+    LOGINFO("[svc()] Created new database with file: %s",regionDBFile.c_str());
+  }
+  catch (DbException& currDBException) {
+    // Need to log error here, cant throw an exception in this thread.
+    LOGERROR("Berkeley DB Persistence Manager failed to create new DB: %s",currDBException.what());
+    return NULL;
+  }
+
+  return dbHandle;
+}
+
+void* BDBHelper::createNewDB(std::string regionDBFile)
+{
+  try {
+        Db *dbHandle = new Db( m_gDbEnv, 0 );
+        dbHandle->set_alloc(::malloc, ::realloc, ::free);
+	dbHandle->open(NULL, regionDBFile.c_str(), "region_db", DB_BTREE, DB_CREATE | DB_THREAD, 0664);
+    
+	return (void *) dbHandle;
+  }
+  catch (DbException& BDBOpenException) {
+    char exceptionMsg[512];
+    sprintf(exceptionMsg, "Failed to open database. Errno : %d, Message : %s",BDBOpenException.get_errno(),BDBOpenException.what());
+    throw InitFailedException(exceptionMsg);
+  }
+}
+
+void BDBHelper::writeToDB(void *dbh,void *keyData,uint32_t keyBufferSize,void *valueData,uint32_t valueBufferSize)
+{
+  // Create BDB objects for storing serialized key and value.
+  Dbt dbKey(keyData,keyBufferSize);
+  Dbt dbValue(valueData,valueBufferSize);
+
+  // Store key and value in DB.
+  Db *dbHandle = (Db *)dbh;
+
+  try {
+    int putRetVal = dbHandle->put(0,&dbKey,&dbValue,0);
+    if (putRetVal != 0) {
+      LOGERROR("Database write failed. Error = %d",putRetVal);
+      throw DiskFailureException("Disk full, No more space available");
+    }
+  }
+  catch (DbException& bdbPutException) {
+    char exceptionMsg[512];
+    sprintf(exceptionMsg,"Database write failed. Error = %d, Message = %s",bdbPutException.get_errno(),bdbPutException.what());
+    throw DiskFailureException(exceptionMsg);
+  }
+}
+
+void BDBHelper::readFromDB(void *dbh,void *keyData,uint32_t keyBufferSize,void*& valueData,uint32_t& valueBufferSize)
+{
+  // Create BDB objects for retrieving value for given key.
+  Dbt dbKey(keyData,keyBufferSize);
+  Dbt dbValue;
+  Db *dbhandle = (Db*) dbh;
+  // Get serialized data from DB.
+  dbValue.set_flags(DB_DBT_MALLOC);
+
+  int getRetVal;
+
+  try {
+    getRetVal = dbhandle->get(0, &dbKey, &dbValue,0 );
+  }
+  catch (DbException& BDBGetException) {
+    char exceptionMsg[512];
+    sprintf(exceptionMsg,"Database read failed. Error = %d, Message = %s",BDBGetException.get_errno(),BDBGetException.what());
+    throw DiskFailureException(exceptionMsg);
+  }
+
+  if (getRetVal == DB_NOTFOUND)
+    throw EntryNotFoundException("Key not in database.");
+  else if (getRetVal != 0)
+    throw DiskFailureException("Key read exception.");
+
+  // Deserialize object and return value.
+  valueData = dbValue.get_data();
+  valueBufferSize = dbValue.get_size();
+}
+
+void BDBHelper::destroy(void *dbHandle,void *keyData,uint32_t keyBufferSize)
+{
+  try {
+    // Create BDB objects for retrieving value for given key.
+    Dbt dbKey(keyData,keyBufferSize);
+    Db *handle = (Db *) dbHandle;
+
+    int delRetVal = handle->del(NULL,&dbKey,0);
+    if(delRetVal)
+    {
+      LOGINFO("Key could not be deleted: %d",delRetVal);
+      throw DiskFailureException("Key delete failed.");
+    }
+  }
+  catch (DbException &BDBException) {
+    throw DiskFailureException(BDBException.what());
+  }
+}
+
+void BDBHelper::closeEnvironment()
+{
+  if (!m_gDbEnv)
+    return;
+
+  if (m_gDbEnv->close(0)) {
+    throw ShutdownFailedException("Failed to close environment.");
+  }
+  ::delete m_gDbEnv;
+}
+
+void BDBHelper::closeDB(void *dbh)
+{
+  Db *dbhandle = (Db*) dbh;
+  dbhandle->close(DB_NOSYNC);
+  ::delete dbhandle;   
+}
+
+/*
+  DBHelper* getBDBHelper() {
+    return new BDBHelper;
+  }
+*/
+
+extern "C" {
+  DBHelper* getBDBHelper() {
+    return new BDBHelper;
+  }
+}
+
+} // end namespace gemfire

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/bdbimpl/BDBImpl.cpp
----------------------------------------------------------------------
diff --git a/geode-client-native/src/bdbimpl/BDBImpl.cpp b/geode-client-native/src/bdbimpl/BDBImpl.cpp
new file mode 100644
index 0000000..690d2b0
--- /dev/null
+++ b/geode-client-native/src/bdbimpl/BDBImpl.cpp
@@ -0,0 +1,521 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *========================================================================
+ */
+
+#include "BDBImpl.hpp"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_sys_stat.h"
+
+namespace gemfire {
+
+  extern "C" DBHelper* getBDBHelper();
+
+};
+
+using namespace gemfire;
+#define MAXFILENAMESIZE 256
+
+namespace {
+  size_t g_default_cache_size_gb = 0;
+  size_t g_default_cache_size_mb = 314572800;
+  uint32_t g_default_paze_size     = 65536;
+  uint32_t g_max_db_file_size      = 512000000;
+  std::string g_default_persistence_directory = "BDBImplRegionData";
+  std::string g_default_env_directory = "BDBImplEnv";
+};
+
+bool BDBImpl::m_isEnvReady=false;
+ACE_Thread_Mutex BDBImpl::m_envReadyLock;
+std::string BDBImpl::m_gEnvDirectory = g_default_env_directory;
+AtomicInc BDBImpl::m_regionCount=0;
+AtomicInc BDBImpl::m_activeDBSize=0;
+
+int bdb_rmdir(const char *);
+
+
+void BDBImpl::init(const RegionPtr& region, PropertiesPtr& diskProperties)
+{
+  // Get db ready to receive data for storage
+  // 1. create DB, DBTable, Keymap
+  // 2. create region directory
+
+  closeFlag=0;
+  m_regionCount++;
+
+  if (region == NULLPTR) {
+    throw InitFailedException("Region passed to init is NULL.");
+  }
+  const char *regionFullPath = region->getFullPath();
+  m_regionName = regionFullPath;
+
+  convertToDirName(m_regionName);
+
+  // Set the default values
+  m_cacheSizeGb = g_default_cache_size_gb;
+  m_cacheSizeMb = g_default_cache_size_mb;
+  m_pageSize    = g_default_paze_size;
+  m_maxDBFileSize = g_max_db_file_size;
+  m_PersistenceDirectory = g_default_persistence_directory + "_" + m_regionName;
+  m_regionEnvDirectory = g_default_env_directory;
+  std::string parentPersistenceDirectory, parentRegionEnvDirectory;
+
+  if (diskProperties != NULLPTR) {
+    CacheableStringPtr cacheSizeGb = diskProperties->find("CacheSizeGb");
+    CacheableStringPtr cacheSizeMb = diskProperties->find("CacheSizeMb");
+    CacheableStringPtr pageSize = diskProperties->find("PageSize");
+    CacheableStringPtr maxFileSize = diskProperties->find("MaxFileSize");
+    CacheableStringPtr persDir = diskProperties->find("PersistenceDirectory");
+    CacheableStringPtr envDir = diskProperties->find("EnvironmentDirectory");
+
+    ACE_TCHAR hname[MAXHOSTNAMELEN];
+    if (ACE_OS::hostname( hname, sizeof(hname)-1) != 0) {
+      throw InitFailedException("Failed to get host name.");
+    }
+    long pid = ACE_OS::getpid();
+    char myDir[512];
+    if (!ACE_OS::snprintf(myDir, sizeof(myDir)-1, "/%s_%ld/", hname, pid)){
+      throw InitFailedException("Failed to create unique directory.");
+    }
+
+    if (cacheSizeGb != NULLPTR) {
+      m_cacheSizeGb = atoi(cacheSizeGb->asChar());
+    }
+    if (cacheSizeMb != NULLPTR) {
+      m_cacheSizeMb = ((unsigned long)atol(cacheSizeMb->asChar()))*(unsigned long)1024*(unsigned long)1024;
+    }
+    if (pageSize != NULLPTR) {
+      m_pageSize = atoi(pageSize->asChar());
+    }
+    if (maxFileSize != NULLPTR) {
+      m_maxDBFileSize = atol(maxFileSize->asChar());
+    }
+    if (persDir != NULLPTR) {
+      parentPersistenceDirectory = persDir->asChar();
+      m_PersistenceDirectory = persDir->asChar() + std::string(myDir);
+    }
+    if (envDir != NULLPTR) {
+      parentRegionEnvDirectory = envDir->asChar();
+      m_regionEnvDirectory = envDir->asChar() + std::string(myDir);
+    }
+  }
+
+  char currWDPath[512];
+  char *wdPath = ACE_OS::getcwd(currWDPath,512);
+
+  // Initialize DB Helper
+
+  m_DBHelper = getBDBHelper();
+
+#ifndef _WIN32
+  if (m_PersistenceDirectory.at(0) != '/') {
+    if (wdPath == NULL) {
+      throw InitFailedException("Failed to get absolute path for persistence directory.");
+    }
+    parentPersistenceDirectory = std::string(wdPath) + "/" + parentPersistenceDirectory;
+    m_PersistenceDirectory = std::string(wdPath) + "/" + m_PersistenceDirectory;
+  }
+
+  if (m_regionEnvDirectory.at(0) != '/') {
+    if (wdPath == NULL) {
+      throw InitFailedException("Failed to get absolute path for environment directory.");
+    }
+    parentRegionEnvDirectory = std::string(wdPath) + "/" + parentRegionEnvDirectory;
+    m_regionEnvDirectory = std::string(wdPath) + "/" + m_regionEnvDirectory;
+  }
+#else
+  if (m_PersistenceDirectory.find(":",0) == std::string::npos) {
+    if (wdPath == NULL) {
+      throw InitFailedException("Failed to get absolute path for persistence directory.");
+    }
+    parentPersistenceDirectory = std::string(wdPath) + "/" + parentPersistenceDirectory;
+    m_PersistenceDirectory = std::string(wdPath) + "/" + m_PersistenceDirectory;
+  }
+
+  if (m_regionEnvDirectory.find(":",0) == std::string::npos) {
+    if (wdPath == NULL) {
+      throw InitFailedException("Failed to get absolute path for persistence environment directory.");
+    }
+    parentRegionEnvDirectory = std::string(wdPath) + "/" + parentRegionEnvDirectory;
+    m_regionEnvDirectory = std::string(wdPath) + "/" + m_regionEnvDirectory;
+  }
+#endif
+
+  LOGINFO("Absolute path for persistence environment directory: %s",m_regionEnvDirectory.c_str());
+  LOGINFO("Absolute path for persistence directory: %s",m_PersistenceDirectory.c_str());
+
+  //ACE_stat fileStat;
+  // Create persistence directory
+  {
+    ACE_Guard<ACE_Thread_Mutex> guard( m_envReadyLock );
+    if (!m_isEnvReady) {
+      // Create and initialize the environment. This is done only once as all regions share the same environment.
+      m_gEnvDirectory = m_regionEnvDirectory;
+      ACE_OS::mkdir(parentRegionEnvDirectory.c_str());
+      ACE_OS::mkdir(m_gEnvDirectory.c_str());
+/*       if (ACE_OS::stat(m_gEnvDirectory.c_str(), &fileStat)) {
+        // Directory creation failure
+        throw InitFailedException("Failed to create environment directory.");
+      }
+ */
+      m_DBHelper->createEnvironment(m_gEnvDirectory,m_cacheSizeGb,m_cacheSizeMb);
+      m_isEnvReady=true;
+
+    } //end if isEnvReady
+  } //end guard
+
+  // Check if persistence directory matches the one which has been initialized.
+  if (m_gEnvDirectory != m_regionEnvDirectory) {
+    throw InitFailedException("Environment directory settings do not match.");
+  }
+
+  // Create persistence directory
+  LOGFINE("Creating persistence directory: %s",m_PersistenceDirectory.c_str());
+  ACE_OS::mkdir(parentPersistenceDirectory.c_str());
+  ACE_OS::mkdir(m_PersistenceDirectory.c_str());
+/*   if (ACE_OS::stat(m_PersistenceDirectory.c_str(), &fileStat)) {
+    // Directory creation failure
+    throw InitFailedException("Failed to create persistence directory.");
+  }
+ */
+  // Create region directory
+  std::string regionDirectory = m_PersistenceDirectory + "/" + m_regionName;
+  ACE_OS::mkdir(regionDirectory.c_str());
+/*   if (ACE_OS::stat(regionDirectory.c_str(), &fileStat)) {
+    // Directory creation failure
+    throw InitFailedException("Failed to create region directory.");
+  }
+ */
+  std::string regionDBFile = regionDirectory + "/file_0.db";
+
+  LOGFINE("Creating persistence region file: %s",regionDBFile.c_str());
+
+  void *dbhandle = m_DBHelper->createNewDB(regionDBFile);
+
+  m_DBHandleVector.push_back(dbhandle);
+  m_currentDBHandle = dbhandle;
+
+  m_currentDBIndex = 0;
+  m_dbFileManager = new DBFileManager(this);
+  m_dbFileManager->activate();
+  LOGFINE("Initialization successful for persistence of region %s", m_regionName.c_str());
+  m_initFlag=true;
+}
+
+void BDBImpl::write(const CacheableKeyPtr&  key, const CacheablePtr&  value, void *& dbHandle)
+{
+  void *handle = dbHandle;
+  bool isUpdate = true;
+
+  if (handle == NULL) {
+    // This guard is required so that the currDBHandle pointer cannot be changed when this write happens.
+    ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_activeDBMutex);
+    handle = m_currentDBHandle;
+    dbHandle = m_currentDBHandle;
+    isUpdate = false;
+  }
+
+  ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_activeDBMutex);
+  if (m_currentDBHandle == NULL) {
+    throw DiskFailureException("Disk handle not available");
+  }
+  writeToDB(handle, key, value, isUpdate);
+}
+
+bool BDBImpl::writeAll()
+{
+  // ARB: Do we need this in persistence?
+  return true;
+}
+
+CacheablePtr BDBImpl::read(const CacheableKeyPtr& key, void *& dbHandle)
+{
+
+  CacheablePtr value;
+  value = readFromDB(dbHandle,key);
+
+  return value;
+}
+
+bool BDBImpl::readAll()
+{
+  // ARB: Used in persistence.
+  return true;
+}
+
+//void BDBImpl::invalidate(const CacheableKeyPtr& key)
+//{
+  // ARB: Used in persistence.
+//}
+
+void BDBImpl::destroyRegion()
+{
+  cleanupRegionData();
+}
+
+//int BDBImpl::numEntries() const
+//{
+  // ARB: Used in persistence.
+ // return 0;
+//}
+
+void BDBImpl::destroy(const CacheableKeyPtr& key, void *& dbHandle)
+{
+
+  // Handle of DB that is used to store the key-value pair has been passed as function argument.
+
+  // Serialize key.
+  DataOutput keyDataBuffer;
+  uint32_t keyBufferSize;
+  //SerializationHelper::serialize( key, keyDataBuffer );
+  keyDataBuffer.writeObject( key );
+  // TODO: correct constness instead of casting
+  void* keyData = const_cast<uint8_t*>(keyDataBuffer.getBuffer(&keyBufferSize));
+
+  m_DBHelper->destroy(dbHandle,keyData,keyBufferSize);
+}
+
+BDBImpl::BDBImpl()
+{
+  // Constructor does nothing. Initialization is done in init().
+  m_initFlag = false;
+  m_dbFileManager = NULL;
+  m_cacheSizeGb = 0;
+  m_cacheSizeMb = 0;
+  m_pageSize = 0;
+  m_maxDBFileSize = 0;
+  m_DBHelper = NULL;
+  m_currentDBHandle = NULL;
+  m_currentDBIndex = 0;
+}
+
+void BDBImpl::writeToDB(void *dbhandle, const CacheableKeyPtr& key, const CacheablePtr& value, bool isUpdate)
+{
+  // Serialize key and value.
+  DataOutput keyDataBuffer, valueDataBuffer;
+  uint32_t keyBufferSize, valueBufferSize;
+  //SerializationHelper::serialize( key, keyDataBuffer );
+  //SerializationHelper::serialize( value, valueDataBuffer);
+  keyDataBuffer.writeObject( key );
+  valueDataBuffer.writeObject( value );
+
+  // TODO: correct constness instead of casting
+  void* keyData = const_cast<uint8_t*>(keyDataBuffer.getBuffer(&keyBufferSize));
+  void* valueData = const_cast<uint8_t*>(valueDataBuffer.getBuffer(
+      &valueBufferSize));
+
+  m_DBHelper->writeToDB(dbhandle,keyData,keyBufferSize,valueData,valueBufferSize);
+
+  if (!isUpdate) {
+    m_activeDBSize += keyBufferSize + valueBufferSize;
+  }
+
+}
+
+CacheablePtr BDBImpl::readFromDB(void *dbhandle, const CacheableKeyPtr &key)
+{
+  // Serialize key.
+  DataOutput keyDataBuffer;
+  uint32_t keyBufferSize;
+  //SerializationHelper::serialize( key, keyDataBuffer );
+  keyDataBuffer.writeObject( key );
+  void* keyData = const_cast<uint8_t*>(keyDataBuffer.getBuffer(&keyBufferSize));
+  void *valueData;
+  uint32_t valueBufferSize;
+
+  m_DBHelper->readFromDB(dbhandle,keyData,keyBufferSize,valueData,valueBufferSize);
+
+  // Deserialize object and return value.
+  uint8_t *valueBytes = (uint8_t *)malloc(sizeof(uint8_t)*valueBufferSize);
+  memcpy(valueBytes, valueData, valueBufferSize);
+  DataInput valueDataBuffer(valueBytes, valueBufferSize);
+  //CacheablePtr retValue = static_cast<CacheablePtr>(SerializationHelper::deserialize(valueDataBuffer).ptr());
+  CacheablePtr retValue;
+  valueDataBuffer.readObject( retValue );
+
+  // Free memory for serialized form of Cacheable object.
+  free(valueData);
+  free(valueBytes);
+
+  return retValue;
+}
+
+int BDBImpl::DBFileManager::svc()
+{
+  //char activeDBFileName[MAXFILENAMESIZE];
+  //ACE_stat activeDBFileStat;
+
+  while(m_isRunning) {
+    // sleep for 1 second for testing.
+    ACE_OS::sleep(1);
+
+    //ARB: **Commenting out file size stat method.
+    //std::string fileNamePrefix = m_bdbPersistenceManager->m_PersistenceDirectory + "/" + m_bdbPersistenceManager->m_regionName + "/file_";
+    //sprintf(activeDBFileName,"%s%d.db",fileNamePrefix.c_str(),m_bdbPersistenceManager->m_currentDBIndex);
+    //if (ACE_OS::stat(activeDBFileName,&activeDBFileStat))
+    //{
+    //  throw DiskFailureException("Failed to stat active db file.");
+    //}
+
+    //long activeDBFileSize = activeDBFileStat.st_size;
+    //LOGINFO("ARB:[svc()] activeDBFileSize = %ld",activeDBFileSize);
+    //LOGINFO("ARB:[svc()] m_maxDBFileSize = %ld",m_bdbPersistenceManager->m_maxDBFileSize);
+    //if (activeDBFileSize > m_bdbPersistenceManager->m_maxDBFileSize)
+    //ARB: **end-comment for file size stat method
+
+    uint64_t thresholdSize = ((uint64_t) 60 * (m_bdbPersistenceManager->m_maxDBFileSize/100));
+
+    if (m_bdbPersistenceManager->m_activeDBSize.value() > thresholdSize)
+    {
+
+      char newDBFileName[MAXFILENAMESIZE];
+      int newIndex = m_bdbPersistenceManager->m_currentDBIndex + 1;
+      sprintf(newDBFileName,"file_%d.db",newIndex);
+      std::string regionDBFile = m_bdbPersistenceManager->m_PersistenceDirectory + "/" + m_bdbPersistenceManager->m_regionName + "/" + newDBFileName;
+
+      // Create new db
+      void *dbHandle = m_bdbPersistenceManager->m_DBHelper->createNewDBNoThrow(regionDBFile);
+
+      m_bdbPersistenceManager->m_DBHandleVector.push_back(dbHandle);
+
+      {
+        // Change the active db.
+        //LOGINFO("ARB:[svc()] Changing active db from %d to %d",m_bdbPersistenceManager->m_currentDBIndex,newIndex);
+	     ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_bdbPersistenceManager->m_activeDBMutex);
+        m_bdbPersistenceManager->m_currentDBIndex = newIndex;
+        m_bdbPersistenceManager->m_currentDBHandle = dbHandle;
+        m_bdbPersistenceManager->m_activeDBSize = 0;
+        if (dbHandle == NULL) {
+         break;
+        }
+        LOGFINEST("BDB:[svc()] %s: Changed active db.",m_bdbPersistenceManager->m_regionName.c_str());
+      }
+
+    } //end if
+  } //end while
+// ARB: must return something for WIN32
+  return 0;
+
+}
+
+void BDBImpl::cleanupRegionData()
+{
+  if (!m_isEnvReady)
+    return;
+
+  if (!m_initFlag)
+    return;
+
+  //ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_activeDBMutex);
+  // ARB: file manager thread should deactivate gracefully.
+  //LOGINFO("ARB: in cleanupRegionData().. about to set m_isRunning to false..:%s",m_regionName.c_str());
+  if (m_dbFileManager) {
+    m_dbFileManager->m_isRunning = false;
+    //join with thread
+    m_dbFileManager->wait();
+    delete m_dbFileManager;
+  }
+
+  // Close all DBs and global db environment. Remove persistence directory.
+  std::string regionDir = m_PersistenceDirectory + "/" +m_regionName;
+  for (int dbIdx=0;dbIdx<m_currentDBIndex+1;dbIdx++)
+  {
+    void *dbhandle;
+
+    try {
+      dbhandle = m_DBHandleVector.at(dbIdx);
+    }
+    catch (...) {
+      // ARB: invalid vector index
+      continue;
+    }
+    m_DBHelper->closeDB(dbhandle);
+
+    char dbFileName[MAXFILENAMESIZE];
+    sprintf(dbFileName,"file_%d.db",dbIdx);
+    std::string regionDBName = regionDir + "/" + dbFileName;
+    LOGINFO("[cleanupRegionData()] Removing region file: %s",regionDBName.c_str());
+    if (ACE_OS::unlink(regionDBName.c_str())) {
+      throw ShutdownFailedException("Failed to remove region db file.");
+    }
+  }
+
+  // ARB: Need to use ACE_OS::rmdir in future
+  if (bdb_rmdir(regionDir.c_str()))
+  {
+    throw ShutdownFailedException("Failed to remove region directory.");
+  }
+  m_regionCount--;
+  if (m_regionCount.value() == 0) {
+    bdb_rmdir(m_PersistenceDirectory.c_str());
+//    ACE_stat fileStat;
+/*     if (!ACE_OS::stat(m_PersistenceDirectory.c_str(), &fileStat))
+    {
+      throw ShutdownFailedException("Failed to remove persistence directory.");
+    }
+ */  }
+}
+
+void BDBImpl::cleanupPersistenceManager()
+{
+
+  cleanupRegionData();
+
+  ACE_Guard<ACE_Thread_Mutex> guard( m_envReadyLock );
+  if (m_regionCount.value() == 0) {
+    m_DBHelper->closeEnvironment();
+    m_isEnvReady=false;
+
+    //Remove persistence directory
+    //ARB: Cleanup db environment files. Can BDB take care on closing environment? A better way is to delete all files in the environment directory.
+    ACE_OS::unlink((m_gEnvDirectory+"/__db.001").c_str());
+    ACE_OS::unlink((m_gEnvDirectory+"/__db.002").c_str());
+    ACE_OS::unlink((m_gEnvDirectory+"/__db.003").c_str());
+    ACE_OS::unlink((m_gEnvDirectory+"/__db.004").c_str());
+    ACE_OS::unlink((m_gEnvDirectory+"/*").c_str());
+    // ARB: Need to use ACE_OS::rmdir in future
+    if (bdb_rmdir(m_gEnvDirectory.c_str()))
+    {
+      LOGERROR("Failed to remove environment directory %s.", m_gEnvDirectory.c_str());
+    }
+  }
+  delete m_DBHelper;
+}
+
+void BDBImpl::convertToDirName(std::string& regionName)
+{
+  for (size_t strIdx=0;strIdx<regionName.length();strIdx++)
+  {
+    if (regionName.at(strIdx) == '/') {
+      regionName.replace(strIdx,1,"_");
+    }
+  }
+}
+
+// Portable function for directory deletion.
+// Need this as ACE5.4 does not have rmdir()
+// For ACE bug, please refer to: http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1409
+int bdb_rmdir(const char *directoryPath)
+{
+  return ACE_OS::rmdir( directoryPath );
+}
+
+void BDBImpl::close()
+{
+  LOGINFO("Persistence closing.");
+  if(closeFlag.value()==0) {
+    closeFlag=1;
+    cleanupPersistenceManager();
+  }
+}
+
+extern "C" {
+
+  LIBEXP PersistenceManager* createBDBInstance() {
+    return new BDBImpl;
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/bdbimpl/BDBImpl.hpp
----------------------------------------------------------------------
diff --git a/geode-client-native/src/bdbimpl/BDBImpl.hpp b/geode-client-native/src/bdbimpl/BDBImpl.hpp
new file mode 100644
index 0000000..cb3e6eb
--- /dev/null
+++ b/geode-client-native/src/bdbimpl/BDBImpl.hpp
@@ -0,0 +1,188 @@
+#ifndef _BDBIMPL_HPP__
+#define _BDBIMPL_HPP__
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *========================================================================
+ */
+
+#include <stdio.h>
+#include <iostream>
+#include <vector>
+#include <map>
+#include <string>
+#include "PersistenceManager.hpp"
+#include "GemfireCppCache.hpp"
+#include "AtomicInc.hpp"
+// ARB:removing-SR
+//#include "impl/SerializationRegistry.hpp"
+// SW:removing SH -- instead use DataOutput/DataInput
+//#include "SerializationHelper.hpp"
+#include <ace/Task.h>
+#include <ace/os_include/os_netdb.h>
+
+#include <cstdlib>
+// ARB: removing db_cxx.h, replacing with DBHelper.
+// #include "db_cxx.h"
+#include "DBHelper.hpp"
+
+/**
+ * @file
+ */
+
+namespace gemfire {
+
+/**
+ * @class Berkeley DB Implementation BDBImpl.hpp
+ * BDB API for overflow.
+ * The BDBImpl class derives from PersistenceManager base class and implements a persistent store with Berkeley DB.
+ *  
+ */
+
+
+class BDBImpl : public PersistenceManager {
+/**
+ * @brief public methods
+ */
+public:
+
+  /**
+   * Initializes the DB for the region. BDB settings are passed via diskProperties argument.
+   * @throws InitfailedException if persistence directory/environment directory initialization fails.
+   */
+  void init(const RegionPtr& regionptr, PropertiesPtr& diskProperties);
+
+  /**
+   * Stores a key-value pair in the BDB implementation. 
+   * @param key the key to write.
+   * @param value the value to write
+   * @throws DiskFailureException if the write fails due to disk failure.
+   */
+  void write(const CacheableKeyPtr&  key, const CacheablePtr&  value, void *& dbHandle);
+
+  /**
+   * Writes the entire region into the BDB implementation.
+   * @throws DiskFailureException if the write fails due to disk fail.
+   */
+  bool writeAll();
+
+  /**
+   * Reads the value for the key from BDB.
+   * @returns value of type CacheablePtr.
+   * @param key is the key for which the value has to be read.
+   * @throws IllegalArgumentException if the key is NULL.
+   * @throws DiskCorruptException if the data to be read is corrupt.
+   */
+ CacheablePtr read(const CacheableKeyPtr& key, void *& dbHandle);
+
+ /**
+  * Read all the keys and values for a region stored in BDB.
+  */
+ bool readAll();
+
+ /**
+  * Invalidates an entry stored in BDB.
+  * @throws IllegalArgumentException if the key is NULL.
+  * @throws RegionDestroyedException is the region is already destroyed.
+  * @throws EntryNotFoundException if the entry is not found on the disk.
+  */
+ //void invalidate(const CacheableKeyPtr& key);
+
+ /**
+  * Destroys an entry stored in BDB. .
+  * @throws IllegalArgumentException if the key is NULL.
+  * @throws RegionDestroyedException is the region is already destroyed.
+  * @throws EntryNotFoundException if the entry is not found on the disk.
+  */
+ void destroy(const CacheableKeyPtr& key, void *& dbHandle);
+
+ /**
+  * Returns number of entries stored in BDB for the region.
+  */
+// ARB: are we removing this method from PersistenceManager? 
+ //int numEntries() const;
+
+ /**
+  * Destroys the region in the BDB implementation. 
+  * @throws RegionDestroyedException is the region is already destroyed.
+  */
+ void destroyRegion();
+
+ /**
+  * Closes the BDB persistence manager implementation.
+  * @throws ShutdownFailedException if clean-up of region and environment files fails..
+  */
+ void close();
+
+ /**
+  * @brief destructor
+  */
+ ~BDBImpl() {
+   LOGDEBUG("calling  ~BDBImpl");
+   if(closeFlag.value()==0) {
+     closeFlag=1;
+     cleanupPersistenceManager();
+   }
+ };
+
+ /**
+  * @brief constructor 
+  */
+ BDBImpl();
+
+ /**
+  * @brief private members
+  */
+
+private:
+
+ /**
+  * BDB Environment. Used for sharing memory pool across dbs.
+  */
+
+ static std::string m_gEnvDirectory;
+ static ACE_Thread_Mutex m_envReadyLock;
+ static bool m_isEnvReady;
+ static AtomicInc m_regionCount;
+ static AtomicInc m_activeDBSize;
+
+ uint32_t m_maxDBFileSize;
+ size_t m_cacheSizeGb;
+ size_t m_cacheSizeMb;
+ uint32_t m_pageSize;
+
+ bool m_initFlag;
+ AtomicInc closeFlag;
+ RegionPtr m_regionPtr;
+ std::string m_regionName;
+ void *m_currentDBHandle;
+ int m_currentDBIndex;
+ ACE_Recursive_Thread_Mutex m_activeDBMutex;
+ std::vector< void * > m_DBHandleVector;
+ std::string m_PersistenceDirectory;
+ std::string m_regionEnvDirectory;
+ DBHelper *m_DBHelper;
+
+ void writeToDB(void *dbhandle, const CacheableKeyPtr& key, const CacheablePtr& value, bool isUpdate);
+ CacheablePtr readFromDB(void *dbhandle, const CacheableKeyPtr &key);
+
+ friend class DBFileManager;
+ class DBFileManager : public ACE_Task_Base {
+  BDBImpl *m_bdbPersistenceManager;
+ public:
+  int svc();
+  bool m_isRunning;
+  DBFileManager(BDBImpl *bdbPersistenceManager) { m_bdbPersistenceManager = bdbPersistenceManager; m_isRunning = true;};
+ };
+
+ DBFileManager* m_dbFileManager;
+ void cleanupPersistenceManager();
+ void cleanupRegionData();
+ void convertToDirName(std::string& regionName);
+};
+
+}
+#endif //_BDBIMPL_HPP__
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/bdbimpl/DBHelper.hpp
----------------------------------------------------------------------
diff --git a/geode-client-native/src/bdbimpl/DBHelper.hpp b/geode-client-native/src/bdbimpl/DBHelper.hpp
new file mode 100644
index 0000000..0e34d0b
--- /dev/null
+++ b/geode-client-native/src/bdbimpl/DBHelper.hpp
@@ -0,0 +1,47 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+#ifndef _DBHELPER_HPP__
+#define _DBHELPER_HPP__
+
+#include <string>
+#ifndef _WIN32
+#include <inttypes.h>
+#else
+// ARB: typedef uint32_t appropriately for Windows
+typedef unsigned int uint32_t;
+#endif
+
+
+namespace gemfire {
+
+class DBHelper {
+
+  public:
+
+    virtual void createEnvironment(std::string m_gEnvDirectory, size_t m_cacheSizeGb, size_t m_cacheSizeMb) {};
+
+    virtual void* createNewDB(std::string regionDBFile) {return NULL;};
+
+    virtual void* createNewDBNoThrow(std::string regionDBFile) {return NULL;};
+
+    virtual void writeToDB(void *dbh,void *keyData,uint32_t keyBufferSize,void *valueData,uint32_t valueBufferSize) {};
+
+    virtual void readFromDB(void *dbh,void *keyData,uint32_t keyBufferSize,void*& valueData,uint32_t& valueBufferSize) {};
+
+    virtual void destroy(void *dbHandle,void *keyData,uint32_t keyBufferSize) {};
+
+    virtual void closeEnvironment() {};
+
+    virtual void closeDB(void *dbh) {};
+
+    virtual ~DBHelper() {};
+};
+
+}
+
+#endif // _DBHELPER_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/bdbimpl/GNUmakefile
----------------------------------------------------------------------
diff --git a/geode-client-native/src/bdbimpl/GNUmakefile b/geode-client-native/src/bdbimpl/GNUmakefile
new file mode 100644
index 0000000..1f4c9d2
--- /dev/null
+++ b/geode-client-native/src/bdbimpl/GNUmakefile
@@ -0,0 +1,73 @@
+ifndef base
+  base=../../../../../../..
+endif
+
+include $(base)/makefiles/platform.gmk
+OBJDIR=$(OSBUILDDIR)/src/bdb_objects
+LIBDIR=$(OSBUILDDIR)/product/lib/$(ARCH).$(OSNAME)
+LIBDIR=$(OSBUILDDIR)/product/lib
+LIBRARY = $(LIBDIR)/$(libPrefix)BDBImpl$(libSuffix)
+
+default: $(LIBRARY)
+
+all: directories
+	$(MAKE) VARIANT=fast
+
+.PHONY: all
+.PHONY: directories
+
+LIBS=$(ACE_DIR)/lib/libACE.a -lgfcppcache -ldb_cxx
+LIB_PATH = -L$(LIBDIR) -L$(BDB)/lib
+INCLUDE=-I. -I$(ACE_DIR)/include -I$(base)/src/com/gemstone/gemfire/internal/cppcache -I$(base)/src/com/gemstone/gemfire/internal/cppcache/impl -I$(BDB)/include
+OUT.c = -o $@
+FILES_cpp := $(wildcard *.cpp)
+FILES_o := $(foreach item, $(subst .cpp,$(OBJ),$(FILES_cpp)),$(OBJDIR)/$(item))
+
+ifeq ($(HOSTTYPE_OSTYPE),$(filter $(HOSTTYPE_OSTYPE),sparc.Solaris x86.Solaris))
+  CXX=CC
+  LIBS += -lrt -lsocket -lm -lnsl
+  CFLAGS_COMMON = -mt -KPIC -D_REENTRANT -D_RWSTD_MULTI_THREAD -DTHREAD=MULTI -D_SOLARIS $(INCLUDE) -c
+  # using -xMMD to fix issue with implicit rule to rebuild string from string.cc
+  CFLAGS_COMMON += -xMMD
+  LD_FLAGS = -KPIC -mt $(CFLAGS_MODEL) -G -Bdynamic -z defs
+  ifdef USE_CPP11
+    CFLAGS_COMMON += -std=c++11
+    LD_FLAGS += -std=c++11
+    LIBS += -lstdc++ -lgcc_s -lCrunG3 
+  else
+    LIBS += -lCstd -lCrun 
+  endif
+  LIBS += -lc
+
+ifeq ($(HOSTTYPE_OSTYPE),sparc.Solaris)
+  CFLAGS_COMMON += -D_SPARC_SOLARIS
+else
+ifeq ($(HOSTTYPE_OSTYPE),x86.Solaris)
+  CFLAGS_COMMON += -D_X86_SOLARIS
+endif
+endif
+else
+ifeq ($(HOSTTYPE_OSTYPE),intel.Linux)
+  CXX=g++
+  CFLAGS_COMMON = -D_REENTRANT -D_LINUX $(INCLUDE) $(FPIC) -c -MD
+  LD_FLAGS = $(CFLAGS_MODEL) -shared
+endif
+endif
+CFLAGS_fast=-O3 $(CFLAGS_COMMON)
+CFLAGS_slow=-O0 -g $(CFLAGS_COMMON)
+
+COMPILE.cpp = $(CXX) $(CFLAGS_MODEL) $(CFLAGS_$(VARIANT))
+
+$(OBJDIR)/%$(OBJ): %.cpp
+	@echo compiling $(VARIANT) $<
+	$(COMPILE.cpp) $(OUT.c) $(call NATIVEDIR_FUNC,$<)
+
+$(LIBRARY): $(FILES_o)
+	$(CXX) $(LD_FLAGS) -o $@ $(FILES_o) $(LIB_PATH) $(LIBS)
+
+directories: $(call UNIXDIR_FUNC,$(OBJDIR))
+
+@mkdir -p $(call UNIXDIR_FUNC,$(OBJDIR)):
+	@mkdir -p $(call UNIXDIR_FUNC,$(OBJDIR))
+
+-include $(FILES_o:.o=.d)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/cclient/Makefile
----------------------------------------------------------------------
diff --git a/geode-client-native/src/cclient/Makefile b/geode-client-native/src/cclient/Makefile
new file mode 100644
index 0000000..0c57e6f
--- /dev/null
+++ b/geode-client-native/src/cclient/Makefile
@@ -0,0 +1,22 @@
+SUBDIRS=src sample
+ARCH=32
+MFLAGS=ARCH=$(ARCH)
+FILES=src/gf_client.h src/libgfcclient.so
+
+all: all_subdirs
+	mkdir -p dist
+	cp $(FILES) dist
+
+clean: clean_subdirs
+	rm -fr dist
+
+all_subdirs:
+	@for i in $(SUBDIRS); do \
+        echo "make all in $$i..."; \
+        (cd $$i; $(MAKE) $(MFLAGS) all); done
+ 
+clean_subdirs:
+	@for i in $(SUBDIRS); do \
+        echo "Clearing in $$i..."; \
+        (cd $$i; $(MAKE) $(MFLAGS) clean); done
+ 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/cclient/README
----------------------------------------------------------------------
diff --git a/geode-client-native/src/cclient/README b/geode-client-native/src/cclient/README
new file mode 100644
index 0000000..388e268
--- /dev/null
+++ b/geode-client-native/src/cclient/README
@@ -0,0 +1,34 @@
+Operating instructions:
+This is first cut of C client for Gemfire cache. 
+Source code is in src directory. There is a sample programe in sample
+directory, which demonstrates basic usage of the library. There is a
+Makefile provided which builds the library, as well as sample program.
+To run the sample program, execute runit.sh in sample directory.
+Befure executing runit.sh GEMFIRE and GFCCLIENT environment variables 
+have to be set. GEMFIRE should contain path to Gemfire installation 
+and GFCCLIENT should contain path to C client dist library (which is
+created while building using Makefile).
+
+NOTES:
+1. gf_connect function returns a CONTEXT pointer which should be passed
+    while doing any operation. 
+2. A CONTEXT pointer should not be used to perform multiple operations
+    simultaneously
+3. A program can maintain a pool of CONTEXT pointers, and any thread can
+    borrow the pointer and return it when done.
+4. There is a gf_ping function in the API. Idle timeout at the server is 
+    60 seconds certain interval, otherwise it closes the socket. A program
+    should call gf_ping function periodically in a separate thread.
+2. gf_disconnect frees up the CONTEXT pointer
+
+
+Troubleshooting:
+Write now, client does not have any logging. For troubleshooting,
+server logs have to be analysed. To enable all logs in the server,
+'log-level=all' has to be passed as command line arguments while 
+starting the server. In samples directory, 'runit.sh' contains the
+command for starting the server with all logging enabled.
+
+Contact information:
+Ankur Srivastava <ankurs@vmware.com>
+Vishal Rao <raov@vmware.com>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/cclient/sample/Makefile
----------------------------------------------------------------------
diff --git a/geode-client-native/src/cclient/sample/Makefile b/geode-client-native/src/cclient/sample/Makefile
new file mode 100644
index 0000000..a779606
--- /dev/null
+++ b/geode-client-native/src/cclient/sample/Makefile
@@ -0,0 +1,25 @@
+CC=gcc
+ARCH=32
+CFLAGS=-m$(ARCH) -Wall -g3
+INCLUDES=-I../src
+LFLAGS=-m$(ARCH) -L../src
+LIBS=-lgfcclient
+NAME=sample
+
+SRCS=sample.c
+OBJS=sample.o
+
+.c.o:
+	$(CC) $(CFLAGS) $(INCLUDES) -c $<  -o $@
+
+.PHONY: clean
+
+all: $(NAME)
+
+$(NAME): $(OBJS) 
+	$(CC) -o $(NAME) $(OBJS) $(LFLAGS) $(LIBS)
+
+clean:
+	$(RM) *.o *~ $(NAME)
+
+sample.o: ../src/gf_client.h

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/cclient/sample/runit.sh
----------------------------------------------------------------------
diff --git a/geode-client-native/src/cclient/sample/runit.sh b/geode-client-native/src/cclient/sample/runit.sh
new file mode 100755
index 0000000..45b2c79
--- /dev/null
+++ b/geode-client-native/src/cclient/sample/runit.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ -z ${GFCCLIENT:-} ]; then
+    echo GFCCLIENT is not set.
+    exit 1
+fi
+if [ -z ${GEMFIRE:-} ]; then
+    echo GEMFIRE is not set.
+    exit 1
+fi
+
+
+export LD_LIBRARY_PATH=$GFCCLIENT:$LD_LIBRARY_PATH
+$GEMFIRE/bin/cacheserver start cache-xml-file=sampleserver.xml log-level=all
+./sample
+$GEMFIRE/bin/cacheserver stop
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/cclient/sample/sample.c
----------------------------------------------------------------------
diff --git a/geode-client-native/src/cclient/sample/sample.c b/geode-client-native/src/cclient/sample/sample.c
new file mode 100644
index 0000000..7ae54a7
--- /dev/null
+++ b/geode-client-native/src/cclient/sample/sample.c
@@ -0,0 +1,85 @@
+#include <gf_client.h>
+#include <stdio.h>
+
+void printByteArray(int8_t* arr, int32_t len)
+{
+    int32_t i = 0;
+    for(i = 0; i < len; i++)
+    {
+        printf("%d", arr[i]);
+    }
+}
+
+
+int main(int argc, char** argv)
+{
+    int resultcode = NO_ERROR;
+    char* key = "key";
+    int8_t data[] = {1,2,3,4};
+    int8_t returnData[4];
+    CONTEXT* context = gf_connect("localhost", "40404", &resultcode);
+    if(resultcode == NO_ERROR)
+    {
+        printf("Connection successful.\n");
+        if(context != NULL) {
+            resultcode = NO_ERROR;
+            printf("Sending ping message... ");
+            gf_ping(context, &resultcode);
+            if(resultcode == NO_ERROR)
+            {
+                printf("successful.\n");
+            } else {
+                printf("failed. Error code: %d\n", resultcode);
+            }
+
+            resultcode = NO_ERROR;
+            printf("Sending put with key=%s, and value=", key);
+            printByteArray(data, 4);
+            printf("... ");
+            gf_put(context, key, data, 4, &resultcode);
+            if(resultcode == NO_ERROR)
+            {
+                printf("successful.\n");
+            } else {
+                printf("failed. Error code: %d\n", resultcode);
+            }
+
+            resultcode = NO_ERROR;
+            printf("Sending get message with key=%s... ", key);
+            gf_get(context, "key",returnData, 1024, &resultcode);
+            if(resultcode == NO_ERROR)
+            {
+                printf("successful. got '");
+                printByteArray(returnData, 4);
+                printf("'.\n");
+            } else {
+                printf("failed. Error code: %d\n", resultcode);
+            }
+
+            resultcode = NO_ERROR;
+            printf("Sending destroy with key=%s... ", key);
+            gf_destroy(context, "key", &resultcode);
+            if(resultcode == NO_ERROR)
+            {
+                printf("successful.\n");
+            } else {
+                printf("failed. Error code: %d\n", resultcode);
+            }
+
+            resultcode = NO_ERROR;
+            printf("disconnecting... ");
+            gf_disconnect(context, &resultcode);
+            if(resultcode == NO_ERROR)
+            {
+                printf("successful.\n");
+            } else {
+                printf("failed. Error code: %d\n", resultcode);
+            }
+        }
+    } else {
+        printf("Connection failure. Error Code: %d\n", resultcode);
+    }
+
+    return 0;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/cclient/sample/sampleserver.xml
----------------------------------------------------------------------
diff --git a/geode-client-native/src/cclient/sample/sampleserver.xml b/geode-client-native/src/cclient/sample/sampleserver.xml
new file mode 100644
index 0000000..ebb05da
--- /dev/null
+++ b/geode-client-native/src/cclient/sample/sampleserver.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+
+<!-- serverBasicOperations.xml
+     Configures a server to for clients at port 40404.
+-->
+
+<!DOCTYPE cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_5.dtd">
+<cache>
+  <cache-server port="40404"/>
+  <region name="ROOT-REGION">
+    <region-attributes scope="distributed-no-ack" data-policy="replicate"/>
+  </region>
+</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/src/cclient/src/Makefile
----------------------------------------------------------------------
diff --git a/geode-client-native/src/cclient/src/Makefile b/geode-client-native/src/cclient/src/Makefile
new file mode 100644
index 0000000..fedbccc
--- /dev/null
+++ b/geode-client-native/src/cclient/src/Makefile
@@ -0,0 +1,27 @@
+CC=gcc
+ARCH=32
+CFLAGS=-m$(ARCH) -Wall -g3 -fPIC	
+INCLUDES=
+LFLAGS=-m$(ARCH) -shared
+LIBS=
+NAME=libgfcclient.so
+
+SRCS=data_io.c gf_client.c
+OBJS=data_io.o gf_client.o
+
+.c.o:
+	$(CC) $(CFLAGS) $(INCLUDES) -c $<  -o $@
+
+.PHONY: clean
+
+all: $(NAME)
+
+$(NAME): $(OBJS) 
+	$(CC) -o $(NAME) $(OBJS) $(LFLAGS) $(LIBS)
+
+clean:
+	$(RM) *.o *~ $(NAME)
+
+
+data_io.o: data_io.h
+gf_client.o: data_io.h gf_client.h


Mime
View raw message