Repository: geode-native Updated Branches: refs/heads/develop c38580a54 -> b2edccfcc
http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/cqQuery/runUpdater.sh ---------------------------------------------------------------------- diff --git a/examples/dist/cqQuery/runUpdater.sh b/examples/dist/cqQuery/runUpdater.sh deleted file mode 100755 index 8b11ec9..0000000 --- a/examples/dist/cqQuery/runUpdater.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -if [ -z ${GFCPP:-} ]; then - echo GFCPP is not set. - exit 1 -fi - -exname='Updater' - -echo Running GemFire C++ example ${exname} ... - -export PATH="${PATH}:${GEMFIRE}/bin" - -${exname} $* - -echo Finished example ${exname}. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/cqQuery/startServer.bat ---------------------------------------------------------------------- diff --git a/examples/dist/cqQuery/startServer.bat b/examples/dist/cqQuery/startServer.bat deleted file mode 100644 index 61ec930..0000000 --- a/examples/dist/cqQuery/startServer.bat +++ /dev/null @@ -1,47 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -rem GFCPP must be set -rem GEMFIRE must be set - - -if not "%GEMFIRE%"=="" goto startexamples - -echo GEMFIRE is not set. -goto finished - - -:startexamples - - -:runexample - -echo. -echo Running GemFire Server - -set CLASSPATH=%CLASSPATH%;../javaobject.jar; -set PATH=%GEMFIRE%\bin;%PATH%;%GEMFIRE%\bin;..\bin; - -if not exist gfecs mkdir gfecs - - - -call cacheserver start cache-xml-file=../XMLs/serverCqQuery.xml mcast-port=35673 -dir=gfecs - -rem pause - -:finished http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/cqQuery/startServer.sh ---------------------------------------------------------------------- diff --git a/examples/dist/cqQuery/startServer.sh b/examples/dist/cqQuery/startServer.sh deleted file mode 100755 index 5d58a8d..0000000 --- a/examples/dist/cqQuery/startServer.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -if [ -z ${GEMFIRE:-} ]; then - echo GEMFIRE is not set. - exit 1 -fi - -echo Running GemFire Server - -export CLASSPATH="${CLASSPATH}:../javaobject.jar" -export PATH="${PATH}:${GEMFIRE}/bin" - -if [ ! -d gfecs ] -then - mkdir gfecs -fi - - cacheserver start cache-xml-file=../XMLs/serverCqQuery.xml mcast-port=35673 -dir=gfecs - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/cqQuery/stopServer.bat ---------------------------------------------------------------------- diff --git a/examples/dist/cqQuery/stopServer.bat b/examples/dist/cqQuery/stopServer.bat deleted file mode 100644 index 96011f9..0000000 --- a/examples/dist/cqQuery/stopServer.bat +++ /dev/null @@ -1,36 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -rem GEMFIRE must be set - - -if not "%GEMFIRE%"=="" goto startexamples - -echo GEMFIRE is not set. -goto finished - - -:startexamples - -echo. -echo Stopping GemFire Server - -set PATH=%GEMFIRE%\bin;%PATH%;%GEMFIRE%\bin;..\bin; - -call cacheserver stop -dir=gfecs -:finished - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/cqQuery/stopServer.sh ---------------------------------------------------------------------- diff --git a/examples/dist/cqQuery/stopServer.sh b/examples/dist/cqQuery/stopServer.sh deleted file mode 100755 index 11f9471..0000000 --- a/examples/dist/cqQuery/stopServer.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -if [ -z ${GEMFIRE:-} ]; then - echo GEMFIRE is not set. - exit 1 -fi - - -echo Stop GemFire Server - -export PATH="${PATH}:${GEMFIRE}/bin" - - -cacheserver stop -dir=gfecs - -echo Stopped Server - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/ExecuteFunctions.cpp ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/ExecuteFunctions.cpp b/examples/dist/executeFunction/ExecuteFunctions.cpp deleted file mode 100644 index 48bb0bc..0000000 --- a/examples/dist/executeFunction/ExecuteFunctions.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * The Execute Function Example. - * - */ - -// Include the GemFire library. -#include <gfcpp/GemfireCppCache.hpp> - -// Include the Execute function headers. -#include <gfcpp/FunctionService.hpp> -#include <gfcpp/Execution.hpp> -#include <gfcpp/ResultCollector.hpp> -#ifndef _WIN32 -#include <unistd.h> -#else -#include <windows.h> -#endif - -// Use the "gemfire" namespace. -using namespace apache::geode::client; - -char* getFuncIName = (char*)"MultiGetFunctionI"; -char* putFuncIName = (char*)"MultiPutFunctionI"; -char* getFuncName = (char*)"MultiGetFunction"; -char* putFuncName = (char*)"MultiPutFunction"; -char* roFuncName = (char*)"RegionOperationsFunction"; - -//customer Result collector -class MyResultCollector : public ResultCollector -{ - public: - MyResultCollector(): - m_resultList(CacheableVector::create()), - m_isResultReady(false), - m_endResultCount(0), - m_addResultCount(0), - m_getResultCount(0) - { - } - ~MyResultCollector() - { - } - CacheableVectorPtr getResult(uint32_t timeout ) - { - m_getResultCount++; - if(m_isResultReady == true) - return m_resultList; - else - { - for(uint32_t i=0; i < timeout; i++) - { -#ifndef _WIN32 - sleep( 1 ); -#else - Sleep( 1 ); -#endif - if(m_isResultReady == true) - return m_resultList; - } - throw FunctionExecutionException( - "Result is not ready, endResults callback is called before invoking getResult() method"); - } - } - - void addResult(CacheablePtr& result) - { - m_addResultCount++; - if(result == NULLPTR) - return; - CacheableArrayListPtr results = dynCast<CacheableArrayListPtr>(result); - for(int32_t i=0; i < results->size(); i++) - { - m_resultList->push_back(results->operator[](i)); - } - } - void endResults() - { - m_isResultReady = true; - m_endResultCount++; - } - uint32_t getEndResultCount() - { - return m_endResultCount; - } - uint32_t getAddResultCount() - { - return m_addResultCount; - } - uint32_t getGetResultCount() - { - return m_getResultCount; - } - - private: - CacheableVectorPtr m_resultList; - volatile bool m_isResultReady; - uint32_t m_endResultCount; - uint32_t m_addResultCount; - uint32_t m_getResultCount; -}; - -// The Execute Function example. -int main(int argc, char ** argv) -{ - try - { - // Create CacheFactory using the settings from the gfcpp.properties file by default. - CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(); - - CachePtr cachePtr = cacheFactory - ->setSubscriptionEnabled(true) - ->addServer("localhost", 50505) - ->addServer("localhost", 40404) - ->create(); - - LOGINFO("Created the GemFire Cache."); - - RegionPtr regPtr0 = cachePtr - ->createRegionFactory(CACHING_PROXY) - ->create("partition_region"); - - LOGINFO("Created the Partition Region."); - - regPtr0->registerAllKeys(); - char buf[128]; - CacheableVectorPtr resultList = CacheableVector::create(); - for(int i=0; i < 34; i++) - { - sprintf(buf, "VALUE--%d", i); - CacheablePtr value(CacheableString::create(buf)); - - sprintf(buf, "KEY--%d", i); - CacheableKeyPtr key = CacheableKey::create(buf); - regPtr0->put(key, value); - } - - bool getResult = true; - CacheableVectorPtr routingObj = CacheableVector::create(); - for(int i=0; i < 34; i++) - { - if(i%2==0) continue; - sprintf(buf, "KEY--%d", i); - CacheableKeyPtr key = CacheableKey::create(buf); - routingObj->push_back(key); - } - LOGINFO("test data independant function with result on one server"); - //test data independant function with result on one server - ExecutionPtr exc = FunctionService::onServer((RegionServicePtr)cachePtr); - CacheablePtr args = routingObj; - CacheableVectorPtr executeFunctionResult = - exc->withArgs(args)->execute(getFuncIName, getResult)->getResult(); - if(executeFunctionResult==NULLPTR) - { - LOGINFO("get executeFunctionResult is NULL"); - } else - { - for (int32_t item=0; item < executeFunctionResult->size(); item++) - { - CacheableArrayListPtr arrayList = dynCast<CacheableArrayListPtr>(executeFunctionResult->operator[](item)); - for (int32_t pos=0; pos < arrayList->size(); pos++) - { - resultList->push_back(arrayList->operator[](pos)); - } - } - sprintf(buf, "get: result count = %d", resultList->size()); - LOGINFO(buf); - for(int32_t i=0; i < executeFunctionResult->size(); i++) - { - sprintf(buf, "get result[%d]=%s", i, dynCast<CacheableStringPtr>(resultList->operator[](i))->asChar()); - LOGINFO(buf); - } - } - - LOGINFO("test data independant function without result on one server"); - getResult = false; - exc->withArgs(args)->execute(putFuncIName, getResult, 15, false); - - LOGINFO("test data independant function with result on all servers"); - getResult = true; - exc = FunctionService::onServers((RegionServicePtr)cachePtr); - executeFunctionResult = - exc->withArgs(args)->execute(getFuncIName, getResult)->getResult(); - if(executeFunctionResult==NULLPTR) - { - LOGINFO("get executeFunctionResult is NULL"); - } else - { - resultList->clear(); - for (int32_t item=0; item < executeFunctionResult->size(); item++) - { - CacheableArrayListPtr arrayList = dynCast<CacheableArrayListPtr>(executeFunctionResult->operator[](item)); - for (int32_t pos=0; pos < arrayList->size(); pos++) - { - resultList->push_back(arrayList->operator[](pos)); - } - } - sprintf(buf, "get result count = %d", resultList->size()); - LOGINFO(buf); - for(int32_t i=0; i < executeFunctionResult->size(); i++) - { - sprintf(buf, "get result[%d]=%s", i, dynCast<CacheableStringPtr>(resultList->operator[](i))->asChar()); - LOGINFO(buf); - } - } - - getResult = false; - LOGINFO("test data independant function without result on all servers"); - exc->withArgs(args)->execute(putFuncIName, getResult, 15, false); - - LOGINFO("test data dependant function with result"); - getResult = true; - args = CacheableBoolean::create( 1 ); - exc = FunctionService::onRegion(regPtr0); - args = CacheableKey::create("echoString"); - executeFunctionResult = - exc->withFilter(routingObj)->withArgs(args)->execute(roFuncName, getResult, 15, true, true)->getResult(); - if(executeFunctionResult==NULLPTR) - { - LOGINFO("echo String : executeFunctionResult is NULL"); - } else - { - LOGINFO("echo String : result count = %d", executeFunctionResult->size()); - const char* str = dynCast<CacheableStringPtr>(executeFunctionResult->operator[](0))->asChar(); - if(strcmp("echoString", str) != 0 ){ - LOGINFO("echoString is not echoed back"); - } - } - args = CacheableKey::create("echoBoolean"); - executeFunctionResult = - exc->withFilter(routingObj)->withArgs(args)->execute(roFuncName, getResult, 15, true, true)->getResult(); - if(executeFunctionResult==NULLPTR) - { - LOGINFO("echo Boolean: executeFunctionResult is NULL"); - } else - { - LOGINFO("echo Boolean: result count = %d", executeFunctionResult->size()); - bool b = dynCast<CacheableBooleanPtr>(executeFunctionResult->operator[](0))->value(); - LOGINFO(b==true ? "true" : "false"); - } - executeFunctionResult = - exc->withFilter(routingObj)->withArgs(args)->execute(getFuncName, getResult)->getResult(); - if(executeFunctionResult==NULLPTR) - { - LOGINFO( "execute on region: executeFunctionResult is NULL"); - } else - { - resultList->clear(); - for (int32_t item=0; item < executeFunctionResult->size(); item++) - { - CacheableArrayListPtr arrayList = dynCast<CacheableArrayListPtr>(executeFunctionResult->operator[](item)); - for (int32_t pos=0; pos < arrayList->size(); pos++) - { - resultList->push_back(arrayList->operator[](pos)); - } - } - LOGINFO( "Execute on Region: result count = %d", executeFunctionResult->size()); - for(int32_t i=0; i < executeFunctionResult->size(); i++) - { - sprintf(buf, "Execute on Region: result[%d]=%s", i, dynCast<CacheableStringPtr>(resultList->operator[](i))->asChar()); - LOGINFO(buf); - } - } - // test get function with customer collector - LOGINFO("test get function without customer collector"); - MyResultCollector *myRC = new MyResultCollector(); - executeFunctionResult = - exc->withFilter(routingObj)->withArgs(args)->withCollector(ResultCollectorPtr(myRC) )->execute(getFuncName, getResult)->getResult(); - LOGINFO("add result count = %d", myRC->getAddResultCount()); - LOGINFO("end result count = %d", myRC->getEndResultCount()); - LOGINFO("get result count = %d", myRC->getGetResultCount()); - - LOGINFO("test data dependant function without result"); - getResult = false; - exc->withFilter(routingObj)->withArgs(args)->execute(putFuncName, getResult, 15, false); - // Close the GemFire Cache. - cachePtr->close(); - - LOGINFO("Closed the GemFire Cache"); - - } - // An exception should not occur - catch(const Exception & gemfireExcp) - { - LOGERROR("Function Execution GemFire Exception: %s", gemfireExcp.getMessage()); - } -} - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/XMLs/serverExecuteFunctions.xml ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/XMLs/serverExecuteFunctions.xml b/examples/dist/executeFunction/XMLs/serverExecuteFunctions.xml deleted file mode 100755 index 04b2c81..0000000 --- a/examples/dist/executeFunction/XMLs/serverExecuteFunctions.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0"?> - -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - - - -<cache xmlns="http://geode.apache.org/schema/cache" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd" - version="1.0"> - <cache-server port="50505"> - <group>ServerGroup1</group> - </cache-server> - <region name='partition_region'> - <region-attributes data-policy="partition"></region-attributes> - </region> - <function-service> - <function> - <class-name>javaobject.MultiGetFunctionI</class-name> - </function> - <function> - <class-name>javaobject.MultiPutFunctionI</class-name> - </function> - <function> - <class-name>javaobject.MultiGetFunction</class-name> - </function> - <function> - <class-name>javaobject.MultiPutFunction</class-name> - </function> - <function> - <class-name>javaobject.RegionOperationsFunction</class-name> - </function> - </function-service> -</cache> http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/XMLs/serverExecuteFunctions2.xml ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/XMLs/serverExecuteFunctions2.xml b/examples/dist/executeFunction/XMLs/serverExecuteFunctions2.xml deleted file mode 100755 index 76ba05a..0000000 --- a/examples/dist/executeFunction/XMLs/serverExecuteFunctions2.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0"?> - -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - - - -<cache xmlns="http://geode.apache.org/schema/cache" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd" - version="1.0"> - <cache-server port="40404"> - <group>ServerGroup1</group> - </cache-server> - <region name='partition_region'> - <region-attributes data-policy="partition"></region-attributes> - </region> - <function-service> - <function> - <class-name>javaobject.MultiGetFunctionI</class-name> - </function> - <function> - <class-name>javaobject.MultiPutFunctionI</class-name> - </function> - <function> - <class-name>javaobject.MultiGetFunction</class-name> - </function> - <function> - <class-name>javaobject.MultiPutFunction</class-name> - </function> - <function> - <class-name>javaobject.RegionOperationsFunction</class-name> - </function> - </function-service> -</cache> http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/buildit.bat ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/buildit.bat b/examples/dist/executeFunction/buildit.bat deleted file mode 100644 index 33f8ea0..0000000 --- a/examples/dist/executeFunction/buildit.bat +++ /dev/null @@ -1,22 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -rem GFCPP must be set - -cl /MD /Zc:wchar_t /EHsc /GR /wd4996 /D_EXAMPLE /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NON_CONFORMING_SWPRINTFS /DWINVER=0x0500 /I%GFCPP%/include /FeExecuteFunctions.exe ExecuteFunctions.cpp %GFCPP%/lib/apache-geode.lib - -del *.obj http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/buildit.sh ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/buildit.sh b/examples/dist/executeFunction/buildit.sh deleted file mode 100755 index fa554fe..0000000 --- a/examples/dist/executeFunction/buildit.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -if [ -z ${GFCPP:-} ]; then - echo GFCPP is not set. - exit 1 -fi - -echo Building GemFire ExecuteFunction - -OPT=-O3 -LIBDIR=lib - -platform=`uname` -is64bit=__IS_64_BIT__ -if [ "$platform" == "SunOS" ]; then - if [ $is64bit -eq 1 ]; then - ARCH="-xarch=v9" - else - ARCH="-xarch=v8plus" - fi - CC=CC - CXX_FLAGS="-mt -D_RWSTD_MULTI_THREAD -DTHREAD=MULTI \ - -D_REENTRANT $OPT $ARCH \ - -I$GFCPP/include \ - -L$GFCPP/$LIBDIR \ - -R$GFCPP/$LIBDIR \ - -lapache-geode -lrt -lpthread -lkstat" -elif [ "$platform" == "Linux" ]; then - if [ $is64bit -eq 1 ]; then - ARCH="-m64" - else - ARCH="-m32" - fi - CC=g++ - CXX_FLAGS="-D_REENTRANT $OPT -Wall $ARCH \ - -I$GFCPP/include \ - -Xlinker -rpath -Xlinker $GFCPP/$LIBDIR -L$GFCPP/$LIBDIR \ - -lapache-geode" -else - echo "This script is not supported on this platform." - exit 1 -fi - -$CC $CXX_FLAGS \ - ExecuteFunctions.cpp -o ExecuteFunctions http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/cleanup.bat ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/cleanup.bat b/examples/dist/executeFunction/cleanup.bat deleted file mode 100644 index cbd8bc3..0000000 --- a/examples/dist/executeFunction/cleanup.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -echo Deleting GemFire Statistics and Log files... - -del /q *.gfs -del /q gfecs\*.* -rmdir gfecs -del /q gfecs2\*.* -rmdir gfecs2 http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/cleanup.sh ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/cleanup.sh b/examples/dist/executeFunction/cleanup.sh deleted file mode 100755 index aa9af02..0000000 --- a/examples/dist/executeFunction/cleanup.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -echo Deleting GemFire Statistics and Log files... - -rm -f *.gfs -rm -f gfecs/* -rmdir gfecs -rm -f gfecs2/* -rmdir gfecs2 http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/runExecuteFunctions.bat ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/runExecuteFunctions.bat b/examples/dist/executeFunction/runExecuteFunctions.bat deleted file mode 100644 index 660c6dc..0000000 --- a/examples/dist/executeFunction/runExecuteFunctions.bat +++ /dev/null @@ -1,35 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -rem GFCPP must be set - -if not "%GFCPP%"=="" goto startexamples - -echo GFCPP is not set. -goto finished - - -:startexamples - -echo. -echo Running GemFire C++ ExecuteFunctions example - -set PATH=%PATH%;%GFCPP%\bin;..\bin; - - -call ExecuteFunctions.exe %1 - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/runExecuteFunctions.sh ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/runExecuteFunctions.sh b/examples/dist/executeFunction/runExecuteFunctions.sh deleted file mode 100644 index e6091d5..0000000 --- a/examples/dist/executeFunction/runExecuteFunctions.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -if [ -z ${GFCPP:-} ]; then - echo GFCPP is not set. - exit 1 -fi - -exname='ExecuteFunctions' - -echo Running GemFire C++ example ${exname} ... - -export PATH="${PATH}:${GEMFIRE}/bin" - -${exname} $* - -echo Finished example ${exname}. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/startServer.bat ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/startServer.bat b/examples/dist/executeFunction/startServer.bat deleted file mode 100644 index 9aefd9b..0000000 --- a/examples/dist/executeFunction/startServer.bat +++ /dev/null @@ -1,49 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -rem GFCPP must be set -rem GEMFIRE must be set - - -if not "%GEMFIRE%"=="" goto startexamples - -echo GEMFIRE is not set. -goto finished - - -:startexamples - - -:runexample - -echo. -echo Running GemFire Server - -set CLASSPATH=%CLASSPATH%;../javaobject.jar; -set PATH=%GEMFIRE%\bin;%PATH%;%GEMFIRE%\bin;..\bin; - -if not exist gfecs mkdir gfecs -if not exist gfecs2 mkdir gfecs2 - - - -call cacheserver start cache-xml-file=../XMLs/serverExecuteFunctions.xml mcast-port=35673 -dir=gfecs -call cacheserver start cache-xml-file=../XMLs/serverExecuteFunctions2.xml mcast-port=35673 -dir=gfecs2 - -rem pause - -:finished http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/startServer.sh ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/startServer.sh b/examples/dist/executeFunction/startServer.sh deleted file mode 100755 index 35ebbeb..0000000 --- a/examples/dist/executeFunction/startServer.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -if [ -z ${GEMFIRE:-} ]; then - echo GEMFIRE is not set. - exit 1 -fi - -echo Running GemFire Server - -export CLASSPATH="${CLASSPATH}:../javaobject.jar" -export PATH="${PATH}:${GEMFIRE}/bin" - -if [ ! -d gfecs ] -then - mkdir gfecs -fi - -if [ ! -d gfecs2 ] -then - mkdir gfecs2 -fi - - cacheserver start cache-xml-file=../XMLs/serverExecuteFunctions.xml mcast-port=35673 -dir=gfecs - - cacheserver start cache-xml-file=../XMLs/serverExecuteFunctions2.xml mcast-port=35673 -dir=gfecs2 http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/stopServer.bat ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/stopServer.bat b/examples/dist/executeFunction/stopServer.bat deleted file mode 100644 index 5fc3dd4..0000000 --- a/examples/dist/executeFunction/stopServer.bat +++ /dev/null @@ -1,37 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -rem GEMFIRE must be set - - -if not "%GEMFIRE%"=="" goto startexamples - -echo GEMFIRE is not set. -goto finished - - -:startexamples - -echo. -echo Stopping GemFire Server - -set PATH=%GEMFIRE%\bin;%PATH%;%GEMFIRE%\bin;..\bin; - -call cacheserver stop -dir=gfecs -call cacheserver stop -dir=gfecs2 -:finished - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/executeFunction/stopServer.sh ---------------------------------------------------------------------- diff --git a/examples/dist/executeFunction/stopServer.sh b/examples/dist/executeFunction/stopServer.sh deleted file mode 100755 index d956ab0..0000000 --- a/examples/dist/executeFunction/stopServer.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -if [ -z ${GEMFIRE:-} ]; then - echo GEMFIRE is not set. - exit 1 -fi - - -echo Stop GemFire Server - -export PATH="${PATH}:${GEMFIRE}/bin" - - -cacheserver stop -dir=gfecs - -cacheserver stop -dir=gfecs2 - -echo Stopped Server - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/overview.html ---------------------------------------------------------------------- diff --git a/examples/dist/overview.html b/examples/dist/overview.html deleted file mode 100755 index 7ea98ac..0000000 --- a/examples/dist/overview.html +++ /dev/null @@ -1,31 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<HTML> -<BODY> - -<p>These demonstration programs provide examples of how to use -GemFire's distributed data caching features.</p> - -<P>The {@link cacheRunner} example provides an interactive command -line utility for experimenting with many of the features of the -GemFire distributed cache.</P> - -<P>The {@link cachetest} example provides an non interactive command -demonstrating operational throughput under various region configurations.</P> - -</BODY> -</HTML> http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/AccountHistory.cpp ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/AccountHistory.cpp b/examples/dist/userobjects/AccountHistory.cpp deleted file mode 100644 index 8976fb1..0000000 --- a/examples/dist/userobjects/AccountHistory.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AccountHistory.hpp" -#include "EClassIds.hpp" -#include <stdio.h> - -using namespace apache::geode::client; - -AccountHistory::AccountHistory( ) -: Cacheable(), - m_history() -{ -} - -/** - * @brief serialize this object - **/ -void AccountHistory::toData( DataOutput& output ) const -{ - size_t itemCount = m_history.size(); - output.writeInt( (int32_t) itemCount ); - for( size_t idx = 0; idx < itemCount; idx++ ) { - // copy each string to the serialization buffer, including the null - // terminating character at the end of the string. - output.writeBytes( (int8_t*) m_history[idx].c_str(), m_history[idx].size() + 1 ); - } -} - -/** - * @brief deserialize this object - **/ -Serializable* AccountHistory::fromData( DataInput& input ) -{ - size_t buflen = 1000; - char* readbuf = new char[buflen]; - uint32_t itemCount = 0; - uint32_t itemLength = 0; - - input.readInt( (uint32_t*) &itemCount ); - for( size_t idx = 0; idx < itemCount; idx++ ) { - input.readInt( (uint32_t*) &itemLength ); - // grow the read buffer if an item exceeds the length. - if ( buflen <= itemLength ) { - buflen = itemLength; - delete [] readbuf; - readbuf = new char[buflen]; - } - // read from serialization buffer into a character array - input.readBytesOnly((uint8_t*) readbuf, itemLength); - // and store in the history list of strings. - m_history.push_back( readbuf ); - } - return this; -} - -/** - * @brief creation function for strings. - */ -Serializable* AccountHistory::createDeserializable( ) -{ - return new AccountHistory(); -} - -/** - *@brief return the classId of the instance being serialized. - * This is used by deserialization to determine what instance - * type to create and derserialize into. - */ -int32_t AccountHistory::classId( ) const -{ - return EClassIds::AccountHistory; -} - -/** Log the state of this in a pretty fashion. */ -void AccountHistory::showAccountHistory( ) const -{ - printf( "AccountHistory: \n" ); - for( size_t idx = 0; idx < m_history.size(); idx++ ) { - printf( " %s\n", m_history[idx].c_str() ); - } -} - -/** Add a entry to the history. */ -void AccountHistory::addLog( const std::string& entry ) -{ - m_history.push_back( entry ); -} - -uint32_t AccountHistory::objectSize( ) const -{ - size_t itemCount = m_history.size(); - uint32_t size = sizeof(AccountHistory); - size += sizeof(itemCount); - for( size_t idx = 0; idx < itemCount; idx++ ) { - size += sizeof(char) * (m_history[idx].size()+1); - } - return size; - -} - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/AccountHistory.hpp ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/AccountHistory.hpp b/examples/dist/userobjects/AccountHistory.hpp deleted file mode 100644 index 68a6d0b..0000000 --- a/examples/dist/userobjects/AccountHistory.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __AccountHistory_hpp__ -#define __AccountHistory_hpp__ 1 - - -#include <gfcpp/GemfireCppCache.hpp> -#include <string> -#include <vector> - -class AccountHistory; -typedef apache::geode::client::SharedPtr< AccountHistory > AccountHistoryPtr; - -/** - * Defines a custom type that can be used as a value in a - * gemfire region. - */ -class AccountHistory : public apache::geode::client::Cacheable -{ - private: - std::vector< std::string > m_history; - - public: - - AccountHistory( ); - - /** - *@brief serialize this object - **/ - virtual void toData( apache::geode::client::DataOutput& output ) const; - - /** - *@brief deserialize this object - **/ - virtual apache::geode::client::Serializable* fromData( apache::geode::client::DataInput& input ); - - /** - * @brief creation function for strings. - */ - static apache::geode::client::Serializable* createDeserializable( ); - - /** - *@brief return the classId of the instance being serialized. - * This is used by deserialization to determine what instance - * type to create and derserialize into. - */ - virtual int32_t classId( ) const; - - /** Log the state of this in a pretty fashion. */ - void showAccountHistory( ) const; - - /** Add a entry to the history. */ - void addLog( const std::string& entry ); - - virtual uint32_t objectSize() const; - -}; - -#endif - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/BankAccount.cpp ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/BankAccount.cpp b/examples/dist/userobjects/BankAccount.cpp deleted file mode 100644 index 26e4c54..0000000 --- a/examples/dist/userobjects/BankAccount.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "BankAccount.hpp" -#include "EClassIds.hpp" -#include <stdio.h> - -using namespace apache::geode::client; - -BankAccount::BankAccount( int customerNum, int accountNum ) -: CacheableKey(), - m_customerId( customerNum ), - m_accountId( accountNum ) -{ -} - -void BankAccount::toData( DataOutput& output ) const -{ - // write each field to the DataOutput. - output.writeInt( m_customerId ); - output.writeInt( m_accountId ); -} - -Serializable* BankAccount::fromData( DataInput& input ) -{ - // set each field from the data input. - input.readInt( &m_customerId ); - input.readInt( &m_accountId ); - return this; -} - -Serializable* BankAccount::createDeserializable( ) -{ - // Create a new instance that will be initialized later by a call to fromData. - return new BankAccount( 0, 0 ); -} - -int32_t BankAccount::classId( ) const -{ - return EClassIds::BankAccount; -} - -bool BankAccount::operator==( const CacheableKey& other ) const -{ - const BankAccount& rhs = static_cast< const BankAccount& >( other ); - return ( m_customerId == rhs.m_customerId ) - && ( m_accountId == rhs.m_accountId ); -} - -uint32_t BankAccount::hashcode( ) const -{ - return /* not the best hash.. */ m_customerId + ( m_accountId << 3 ); -} - -void BankAccount::showAccountIdentifier( ) const -{ - printf( "BankAccount( customer: %d, account: %d )\n", - m_customerId, m_accountId ); -} - -uint32_t BankAccount::objectSize( ) const -{ - return sizeof(BankAccount) ; -} http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/BankAccount.hpp ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/BankAccount.hpp b/examples/dist/userobjects/BankAccount.hpp deleted file mode 100644 index abd77d4..0000000 --- a/examples/dist/userobjects/BankAccount.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __BankAccount_hpp__ -#define __BankAccount_hpp__ 1 - - -#include <gfcpp/GemfireCppCache.hpp> - - -class BankAccount; -typedef apache::geode::client::SharedPtr< BankAccount > BankAccountPtr; - -/** - * Defines a custom type that can be used as a key in - * a gemfire region. - */ -class BankAccount : public apache::geode::client::CacheableKey -{ - private: - - int m_customerId; - int m_accountId; - - public: - - BankAccount( int customerNum, int accountNum ); - - /** - *@brief serialize this object - **/ - virtual void toData( apache::geode::client::DataOutput& output ) const; - - /** - *@brief deserialize this object - **/ - virtual apache::geode::client::Serializable* fromData( apache::geode::client::DataInput& input ); - - /** - * @brief creation function for strings. - */ - static apache::geode::client::Serializable* createDeserializable( ); - - /** - *@brief return the classId of the instance being serialized. - * This is used by deserialization to determine what instance - * type to create and derserialize into. - */ - virtual int32_t classId( ) const; - - /** return true if this key matches other. */ - virtual bool operator==( const apache::geode::client::CacheableKey& other ) const; - - /** return the hashcode for this key. */ - virtual uint32_t hashcode( ) const; - - /** Log the state of this in a pretty fashion. */ - void showAccountIdentifier( ) const; - - virtual uint32_t objectSize() const; -}; - -namespace apache { -namespace geode { -namespace client { - -/** overload of apache::geode::client::createKey to pass CacheableInt32Ptr */ -inline CacheableKeyPtr createKey( const BankAccountPtr& value ) -{ - return value; -} - -} - -#endif - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/EClassIds.hpp ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/EClassIds.hpp b/examples/dist/userobjects/EClassIds.hpp deleted file mode 100644 index 84b9ea6..0000000 --- a/examples/dist/userobjects/EClassIds.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __EClassIds_hpp__ -#define __EClassIds_hpp__ 1 - -/** Class that holds the enum with each unique types serialization id. */ -class EClassIds -{ - public: - - enum { - AccountHistory = 0x02, - BankAccount = 0x03 - }; -}; - -#endif - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/ExampleMain.cpp ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/ExampleMain.cpp b/examples/dist/userobjects/ExampleMain.cpp deleted file mode 100644 index 8a8bfbb..0000000 --- a/examples/dist/userobjects/ExampleMain.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <gfcpp/GemfireCppCache.hpp> -#include "BankAccount.hpp" -#include "AccountHistory.hpp" - -using namespace apache::geode::client; - -/* - This example registers types, creates the cache, creates a - region, and then puts and gets user defined type BankAccount. -*/ -int main( int argc, char** argv ) -{ - // Register the user defined, serializable type. - Serializable::registerType( AccountHistory::createDeserializable ); - Serializable::registerType( BankAccount::createDeserializable ); - - // Create a cache. - CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(); - CachePtr cachePtr = cacheFactory->setSubscriptionEnabled(true)->create(); - - LOGINFO("Created the GemFire Cache"); - - RegionFactoryPtr regionFactory = cachePtr->createRegionFactory(LOCAL); - - LOGINFO("Created the RegionFactory"); - - // Create the Region programmatically. - RegionPtr regionPtr = regionFactory->create("BankAccounts"); - - LOGINFO("Created the Region from the Cache"); - - // Place some instances of BankAccount cache region. - BankAccountPtr baKeyPtr(new BankAccount(2309, 123091)); - AccountHistoryPtr ahValPtr(new AccountHistory()); - ahValPtr->addLog( "Created account" ); - - regionPtr->put( baKeyPtr, ahValPtr ); - printf( "Put an AccountHistory in cache keyed with BankAccount.\n" ); - // Call custom behavior on instance of BankAccount. - baKeyPtr->showAccountIdentifier(); - // Call custom behavior on instance of AccountHistory. - ahValPtr->showAccountHistory(); - - // Get a value out of the region. - AccountHistoryPtr historyPtr = dynCast<AccountHistoryPtr>( regionPtr->get( baKeyPtr ) ); - if (historyPtr != NULLPTR) { - printf( "Found AccountHistory in the cache.\n" ); - historyPtr->showAccountHistory(); - - historyPtr->addLog( "debit $1,000,000." ); - regionPtr->put( baKeyPtr, historyPtr ); - printf( "Updated AccountHistory in the cache.\n" ); - } - - // Look up the history again. - historyPtr = dynCast<AccountHistoryPtr>( regionPtr->get( baKeyPtr ) ); - if (historyPtr != NULLPTR) { - printf( "Found AccountHistory in the cache.\n" ); - historyPtr->showAccountHistory(); - } - - // Close the cache. - cachePtr->close(); - - return 0; -} - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/README.html ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/README.html b/examples/dist/userobjects/README.html deleted file mode 100644 index 914a055..0000000 --- a/examples/dist/userobjects/README.html +++ /dev/null @@ -1,122 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<HEAD> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> -<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> -<META NAME="GENERATOR" CONTENT="Adobe FrameMaker 7.0/HTML Export Filter"> - -<TITLE>userobjects: Pivotal™ GemFire® Native Client C++ Example</TITLE> -</HEAD> -<BODY> - <IMG SRC="../../../docs/PIVOTAL_GemFire_190x81.png" BORDER="0"> - <DIV> - <h1 align="center"><a name="Top" id="Top"></a>userobjects</h1> - <h2 align="center"> - Pivotal<b><sup><font size=-0>™</font></sup></b> GemFire<b><sup><font size=-0>®</font></sup></b> Native Client </h2> - <h2 align="center">C++ Programming Example</h2> -</DIV> -<DIV> -<H2> -<br> -About the userobjects Example </H2> -<P>The <code>userobjects</code> example demonstrates the native client C++ API for distributing and retrieving custom-defined user types. The example uses <code>gemfire::CacheableKey</code> to define a key type suitable for storage as a value in the cache. See the C++ API documentation for a description of <code>gemfire::CacheableKey</code>. You can also review the example source code in the <code>userobjects</code> directory. </P> -<P>The <code>userobjects</code> example is located in <code>NativeClient_InstallDir/SampleCode/examples/userobjects</code>.</P> -<br> -</DIV> - -<DIV> -<H2> -<a name="configuring_environment" id="configuring_environment"></a>Configuring the Environment </H2> -</DIV> - <DIV> - <p>The following is a list of the environment configuration commands for the <code>userobjects</code> example. Choose the set of commands that are appropriate for your operating system. The text that you type is shown in <strong><code>bold</code></strong>.</p> -<p><strong>Bourne and Korn shells (sh, ksh, bash)</strong> </p> -<blockquote> - <p><code> % <strong>GFCPP=<path to NativeClient_InstallDir directory>; export GFCPP </strong><br> - % <strong>PATH=$GFCPP/bin:$PATH; export PATH</strong><br> - % <strong>LD_LIBRARY_PATH=$GFCPP/lib; export LD_LIBRARY_PATH</strong></code></p> -</blockquote> -<p><strong>Windows</strong></p> -<blockquote> - <p><em>The Windows native client installer sets the required environment configurations for you, so they are listed for reference only.</em></p> - <p><code>> GFCPP=<path to NativeClient_InstallDir directory><br> - > PATH=%GFCPP%\bin;%PATH%<br> - <br> - <br> - </code></p> -</blockquote> -</DIV> - -<DIV> -<H2>Running userobjects</H2> -<P> -Follow these steps to run the <code>userobjects</code> example. The steps reflect Windows operations, so alter them as needed for your operating system.</P> -</DIV> -<DIV> -<OL> -<LI CLASS="Numbered-1st"> - <p> -Create a session, then configure the session environment according to the steps listed in <a href="#configuring_environment">Configuring the Environment</a><a href="../envsetup.html" target="_blank"></a>.</p> -</LI> -<LI CLASS="Numbered-1st">Go to the <code>userobjects</code> example directory.</LI> -<blockquote> - <p><strong> <code>cd NativeClient_InstallDir\SampleCode\examples\userobjects</code></strong></p> -</blockquote> -<LI CLASS="Numbered"> -Enter this command to start the example: - - <blockquote> - <p><strong> - <code>userobjects</code></strong></p> - </blockquote> - </LI> - -<p>The process registers custom serializable types, then connects to the distributed system. It creates a cache and region, then creates a new <code>AccountHistory</code> and puts it in the cache. Next, it gets <code>AccountHistory</code> from the cache and updates it.</p> -<p>This is the example output:</p> -<blockquote> - <p><code>Put an AccountHistory in cache keyed with BankAccount.<br> - BankAccount( customer: 2309, account: 123091 )<br> - AccountHistory:<br> - Created account<br> - Found AccountHistory in the cache.<br> - AccountHistory:<br> - Created account<br> - Updated AccountHistory in the cache.<br> - Found AccountHistory in the cache.<br> - AccountHistory:<br> - Created account<br> - debit $1,000,000.</code></p> - </blockquote> - <LI CLASS="Numbered">Close the session by entering <code>exit</code>.</LI> -</OL> -<br> -</DIV> -<DIV> -<H2> -Changing System Parameters</H2> -<P> -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 <em>GemFire User's Guide</em> for instructions on configuring TCP transport for membership and discovery. <code><br> - <br> -</code></P> -</DIV> -<a href="#Top">Top</a> -<P> -<br> -</BODY> -</HTML> - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/buildit.bat ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/buildit.bat b/examples/dist/userobjects/buildit.bat deleted file mode 100755 index c7881a6..0000000 --- a/examples/dist/userobjects/buildit.bat +++ /dev/null @@ -1,22 +0,0 @@ -@echo off - -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. - -echo "GFCPP=%GFCPP%" - -cl /MD /Zc:wchar_t /GR /EHsc /wd4996 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NON_CONFORMING_SWPRINTFS /DWINVER=0x0500 /I%GFCPP%\include /Feuserobjects.exe *.cpp %GFCPP%\lib\apache-geode.lib - -del *.obj http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/dist/userobjects/buildit.sh ---------------------------------------------------------------------- diff --git a/examples/dist/userobjects/buildit.sh b/examples/dist/userobjects/buildit.sh deleted file mode 100755 index beffce7..0000000 --- a/examples/dist/userobjects/buildit.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -if [ -z ${GFCPP:-} ]; then - echo set GFCPP... - exit 1 -fi - -OPT=-O3 -LIBDIR=lib - -platform=`uname` -is64bit=__IS_64_BIT__ -if [ "$platform" == "SunOS" ]; then - if [ $is64bit -eq 1 ]; then - ARCH="-xarch=v9" - else - ARCH="-xarch=v8plus" - fi - CC \ - -D_REENTRANT $OPT $ARCH \ - -I$GFCPP/include \ - -L$GFCPP/$LIBDIR \ - -R$GFCPP/$LIBDIR \ - *.cpp -o userobjects -lapache-geode -lrt -lcollector -lkstat -elif [ "$platform" == "Linux" ]; then - if [ $is64bit -eq 1 ]; then - ARCH="-m64" - else - ARCH="-m32" - fi - g++ \ - -D_REENTRANT $OPT -Wall -Werror $ARCH \ - -I$GFCPP/include \ - -Xlinker -rpath -Xlinker $GFCPP/$LIBDIR -L$GFCPP/$LIBDIR \ - *.cpp -o userobjects -lapache-geode -else - echo "This script is not supported on this platform." - exit 1 -fi - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/unix_README.html ---------------------------------------------------------------------- diff --git a/examples/unix_README.html b/examples/unix_README.html deleted file mode 100644 index 9f6ceb4..0000000 --- a/examples/unix_README.html +++ /dev/null @@ -1,57 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML> -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - <HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> - <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> - <LINK REL="STYLESHEET" HREF="../../docs/DocIndex.css" CHARSET="ISO-8859-1" TYPE="text/css"> - <TITLE>Pivotal GemFire® Native Client Examples</TITLE> - <style type="text/css"> -<!-- -.style1 {font-style: italic} -.style2 {font-size: medium} ---> - </style> -</HEAD> -<BODY bgcolor="#ffffff"> - <IMG SRC="../../docs/PIVOTAL_GemFire_190x81.png" BORDER="0"> - <h1 align="left"> - <FONT size=6><b>Pivotal GemFire<FONT size=6><b><sup><font size=-0>®</font></sup></b></FONT> Native Client C++ Examples </H1></b></FONT> - <hr color="#330066" width=650 size="1" align="left"> - <table border=0 cellspacing=0 cellpadding=5 width=650> - <tr> - <td valign="top"><strong>C++ Examples</strong></td> - <td valign="top"><p><a href="cacheRunner/README.html" target="_blank"><strong>cacheRunner</strong></a></b>: - Shows how to modify and view cache contents, perform queries on cached data, maintain highly available client queues after server failover, and authenticate client credentials.</p> - <p><a href="userobjects/README.html" target="_blank"><strong>userobjects</strong></a>: - Demonstrates the native client C++ API for distributing and retrieving custom-defined user types.</p> - <p><a href="cqQuery/README.html" target="_blank"><strong>cqQuery</strong></a>: - Demonstrates the native client C++ API for continuous query.</p> - <hr color="#330066" width="75%" size="1" align="left"> </td> - </tr> - <tr> - <tr> - <td valign="top" width="24%"><a href="../../docs/cppdocs/index.html" target="_blank"><strong>C++ API Reference</strong></a> </td> - - <td valign="top"> - Online C++ API documentation for the native client. - - <hr color="#330066" width="75%" size="1" align="left"> </td> - </tr> - </table> -</BODY> -</HTML> http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/win_README.html ---------------------------------------------------------------------- diff --git a/examples/win_README.html b/examples/win_README.html deleted file mode 100644 index 7feee55..0000000 --- a/examples/win_README.html +++ /dev/null @@ -1,73 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML> -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - <HEAD> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> - <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> - <LINK REL="STYLESHEET" HREF="../../docs/DocIndex.css" CHARSET="ISO-8859-1" TYPE="text/css"> - <TITLE>Pivotal GemFire® Native Client Examples</TITLE> - <style type="text/css"> -<!-- -.style1 {font-style: italic} -.style2 {font-size: medium} ---> - </style> -</HEAD> -<BODY bgcolor="#ffffff"> - <IMG SRC="../../docs/PIVOTAL_GemFire_190x81.png" BORDER="0"> - <h1 align="left"> - <FONT size=6><b>Pivotal GemFire</b><FONT size=6><b><sup><font size=-0>®</font></sup></b></FONT></FONT> Native Client C++ and C# Examples </H1> - <hr color="#330066" width=650 size="1" align="left"> - <table border=0 cellspacing=0 cellpadding=5 width=650> - <tr> - <td valign="top"><strong>C++ Examples</strong></td> - <td valign="top"><p><a href="cacheRunner/README.html" target="_blank"><strong>cacheRunner</strong></a></b>: - Shows how to modify and view cache contents, perform queries on cached data, maintain highly available client queues after server failover, and authenticate client credentials.</p> - <p><a href="userobjects/README.html" target="_blank"><strong>userobjects</strong></a>: - Demonstrates the native client C++ API for distributing and retrieving custom-defined user types.</p> - <p><a href="cqQuery/README.html" target="_blank"><strong>cqQuery</strong></a>: - Demonstrates the native client C++ API for continuous query.</p> - <hr color="#330066" width="75%" size="1" align="left"> </td> - </tr> - <tr> - <td valign="top"><strong>C# Examples</strong></td> - <td valign="top"><p><a href="cli_ProductBrowser/README.html" target="_blank"><strong>ProductBrowser</strong></a>: - Presents heterogeneous client access by using both a .NET client and a Java client to interact with a Java cache server and exchange data between the clients.</p> - <p><a href="cli_CacheRunner/README.html" target="_blank"><strong>CacheRunner</strong></a></b>: - Shows how to modify and view cache contents, perform queries on cached data, and maintain highly available client queues after server failover.</p> - <p><a href="cli_CqQuery/README.html" target="_blank"><strong>CqQuery</strong></a>: Demonstrate the usage of C# continuous query API. - <hr color="#330066" width="75%" size="1" align="left"> </td> - </tr> - <tr> - <td valign="top" width="24%"><a href="../../docs/DotNetDocs/index.html" target="_blank"><strong>.NET API Reference</strong></a> </td> - - <td valign="top"> - Online .NET API documentation for the native client. - - <hr color="#330066" width="75%" size="1" align="left"> </td> - </tr> - <tr> - <td valign="top" width="24%"><a href="../../docs/cppdocs/index.html" target="_blank"><strong>C++ API Reference</strong></a> </td> - - <td valign="top"> - Online C++ API documentation for the native client. - - <hr color="#330066" width="75%" size="1" align="left"> </td> - </tr> - </table> -</BODY> -</HTML>
