You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ec...@apache.org on 2018/02/22 03:17:21 UTC
[geode-native] branch develop updated (541178a -> 2501051)
This is an automated email from the ASF dual-hosted git repository.
echobravo pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git.
from 541178a Locking down the openssh version temporarily.
new 8c8f4d9 GEODE-4697: Rename ClientHandShake to ServerSideHandshake
new fb4c544 GEODE-4697: Remove tests that use FunctionExecutionTimeout
new 8b38302 GEODE-4697: Removing FunctionExecutionTimeout from server configs
new 70eed16 GEODE-4697: Removing FunctionExecutionTimeout from cppcache in addition to clicache
new 2501051 GEODE-4697: Removing FunctionExecutionTimeout from CLI tests
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../ThinClientFunctionExecutionTestsN.cs | 105 --
.../integration-test/func_cacheserver1_pool.xml | 138 +--
.../integration-test/func_cacheserver2_pool.xml | 135 +--
.../integration-test/func_cacheserver3_pool.xml | 120 +-
.../resources/func_cacheserver1_pool.xml | 144 ++-
.../resources/func_cacheserver2_pool.xml | 143 ++-
.../resources/func_cacheserver3_pool.xml | 128 +-
.../testThinClientExecuteFunctionPrSHOP.cpp | 609 ----------
.../testThinClientPoolExecuteFunction.cpp | 1244 --------------------
.../testThinClientPoolExecuteFunctionPrSHOP.cpp | 1194 -------------------
...hinClientPoolExecuteFunctionThrowsException.cpp | 1 -
tests/javaobject/FunctionExecutionTimeOut.java | 81 --
12 files changed, 379 insertions(+), 3663 deletions(-)
delete mode 100644 cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
delete mode 100644 cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
delete mode 100644 cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
delete mode 100644 tests/javaobject/FunctionExecutionTimeOut.java
--
To stop receiving notification emails like this one, please contact
echobravo@apache.org.
[geode-native] 05/05: GEODE-4697: Removing FunctionExecutionTimeout
from CLI tests
Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
echobravo pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
commit 25010514dff79306b5075d8d83a9dc73bfca1862
Author: Ryan McMahon <rm...@pivotal.io>
AuthorDate: Tue Feb 20 16:57:35 2018 -0800
GEODE-4697: Removing FunctionExecutionTimeout from CLI tests
---
.../ThinClientFunctionExecutionTestsN.cs | 105 ---------------------
1 file changed, 105 deletions(-)
diff --git a/clicache/integration-test/ThinClientFunctionExecutionTestsN.cs b/clicache/integration-test/ThinClientFunctionExecutionTestsN.cs
index 7c6dfcb..3dca0c5 100644
--- a/clicache/integration-test/ThinClientFunctionExecutionTestsN.cs
+++ b/clicache/integration-test/ThinClientFunctionExecutionTestsN.cs
@@ -129,7 +129,6 @@ namespace Apache.Geode.Client.UnitTests
private static string FEOnRegionPrSHOP_OptimizeForWrite = "FEOnRegionPrSHOP_OptimizeForWrite";
private static string putFuncName = "MultiPutFunction";
private static string putFuncIName = "MultiPutFunctionI";
- private static string FuncTimeOutName = "FunctionExecutionTimeOut";
#endregion
@@ -953,60 +952,6 @@ namespace Apache.Geode.Client.UnitTests
}
}
- public void ExecuteFETimeOut()
- {
- Region region = CacheHelper.GetVerifyRegion<object, object>(QERegionName);
- for (int i = 0; i < 230; i++)
- {
- region[i] = "VALUE--" + i;
- }
-
- object args = 5000 * 1000;
-
- Execution<object> exc = Client.FunctionService<object>.OnRegion<object, object>(region);
- for (int k = 0; k < 210; k++)
- {
- int j = 0;
- Object[] filter = new Object[20];
- for (int i = k; i < k + 20; i++)
- {
- filter[j] = i;
- j++;
- }
- Util.Log("filter count= {0}.", filter.Length);
-
- IResultCollector<object> rc = exc.WithArgs<Object>(args).WithFilter<object>(filter).Execute(FuncTimeOutName, TimeSpan.FromSeconds(5000));
- ICollection<object> FunctionResult = rc.GetResult();
- Util.Log("ExecuteFETimeOut onRegion FunctionResult.Count = {0} ", FunctionResult.Count);
- Assert.AreEqual(true, FunctionResult.Any(), "ExecuteFETimeOut item never true");
- Util.Log("ExecuteFETimeOut onRegion Done");
- }
-
- Pool pool = CacheHelper.DCache.GetPoolManager().Find(poolName);
- Execution<object> excs = Client.FunctionService<object>.OnServer(pool);
- IResultCollector<object> rcs = excs.WithArgs<Object>(args).Execute(FuncTimeOutName, TimeSpan.FromSeconds(5000));
- ICollection<object> ServerFunctionResult = rcs.GetResult();
- Util.Log("ExecuteFETimeOut onServer FunctionResult.Count = {0} ", ServerFunctionResult.Count);
- foreach (Boolean item in ServerFunctionResult)
- {
- Util.Log("on server:ExecuteFETimeOut:= {0}.", item);
- Assert.AreEqual(true, item, "ExecuteFETimeOut item not true");
- }
- Util.Log("ExecuteFETimeOut onServer Done");
-
-
- Execution<object> excss = Client.FunctionService<object>.OnServers(pool);
- IResultCollector<object> rcss = excss.WithArgs<Object>(args).Execute(FuncTimeOutName, TimeSpan.FromSeconds(5000));
- ICollection<object> ServerFunctionResults = rcss.GetResult();
- Util.Log("ExecuteFETimeOut onServer FunctionResult.Count = {0} ", ServerFunctionResults.Count);
- foreach (Boolean item in ServerFunctionResults)
- {
- Util.Log("on servers:ExecuteFETimeOut:= {0}.", item);
- Assert.AreEqual(true, item, "ExecuteFETimeOut item not true");
- }
- Util.Log("ExecuteFETimeOut onServers Done");
- }
-
public void ExecuteFEOnRegionMultiFilterKeyStepTwo()
{
Region region = CacheHelper.GetVerifyRegion<object, object>(QERegionName);
@@ -1554,44 +1499,6 @@ namespace Apache.Geode.Client.UnitTests
CacheHelper.ClearLocators();
}
- void runExecuteFunctionTimeOut(bool singleHop)
- {
- CacheHelper.SetupJavaServers(true, "func_cacheserver1_pool.xml",
- "func_cacheserver2_pool.xml", "func_cacheserver3_pool.xml");
- CacheHelper.StartJavaLocator(1, "GFELOC");
- Util.Log("Locator 1 started.");
- CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
- Util.Log("Cacheserver 1 started.");
- CacheHelper.StartJavaServerWithLocators(2, "GFECS2", 1);
- Util.Log("Cacheserver 2 started.");
- CacheHelper.StartJavaServerWithLocators(3, "GFECS3", 1);
- Util.Log("Cacheserver 3 started.");
-
- m_client1.Call(createPool, poolName, CacheHelper.Locators, serverGroup, 1, true, singleHop, /*threadLocal*/false);
- m_client1.Call(createRegionAndAttachPool, QERegionName, poolName);
- Util.Log("Client 1 (pool locator) regions created");
-
- m_client1.Call(ExecuteFETimeOut);
-
- m_client1.Call(Close);
- Util.Log("Client 1 closed");
-
- CacheHelper.StopJavaServer(1);
- Util.Log("Cacheserver 1 stopped.");
-
- CacheHelper.StopJavaServer(2);
- Util.Log("Cacheserver 2 stopped.");
-
- CacheHelper.StopJavaServer(3);
- Util.Log("Cacheserver 3 stopped.");
-
- CacheHelper.StopJavaLocator(1);
- Util.Log("Locator 1 stopped.");
-
- CacheHelper.ClearEndpoints();
- CacheHelper.ClearLocators();
- }
-
void runFEOnRegionTx(bool singleHop)
{
CacheHelper.SetupJavaServers(true, "func_cacheserver1_pool.xml");
@@ -1823,18 +1730,6 @@ namespace Apache.Geode.Client.UnitTests
}
[Test]
- public void ExecuteFunctionTimeOut()
- {
- runExecuteFunctionTimeOut(false);
- }
-
- [Test]
- public void ExecuteFunctionTimeOutSingleHop()
- {
- runExecuteFunctionTimeOut(true);
- }
-
- [Test]
public void TestFEOnRegionPrSHOPMultiFilterKey()
{
runFEOnRegionPrSHOPMultiFilterKey(true);
--
To stop receiving notification emails like this one, please contact
echobravo@apache.org.
[geode-native] 02/05: GEODE-4697: Remove tests that use
FunctionExecutionTimeout
Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
echobravo pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
commit fb4c5446fcfe997bcc449157b0726f81b4702817
Author: Michael Oleske <mo...@pivotal.io>
AuthorDate: Tue Feb 20 10:15:15 2018 -0800
GEODE-4697: Remove tests that use FunctionExecutionTimeout
---
.../testThinClientExecuteFunctionPrSHOP.cpp | 609 ----------
.../testThinClientPoolExecuteFunction.cpp | 1244 --------------------
.../testThinClientPoolExecuteFunctionPrSHOP.cpp | 1194 -------------------
tests/javaobject/FunctionExecutionTimeOut.java | 81 --
4 files changed, 3128 deletions(-)
diff --git a/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
deleted file mode 100644
index 078e6a8..0000000
--- a/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
+++ /dev/null
@@ -1,609 +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.
- */
-
-#define ROOT_NAME "testThinClientExecuteFunctionPrSHOP"
-
-#include "fw_dunit.hpp"
-#include "ThinClientHelper.hpp"
-#include "testobject/VariousPdxTypes.hpp"
-#include <geode/FunctionService.hpp>
-#include <geode/DefaultResultCollector.hpp>
-
-using namespace PdxTests;
-/* This is to test
-1- funtion execution on pool
-*/
-
-#define CLIENT1 s1p1
-#define LOCATOR1 s2p1
-#define SERVER s2p2
-
-bool isLocalServer = false;
-bool isLocator = false;
-
-const char* locHostPort =
- CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-const char* poolRegNames[] = {"partition_region", "PoolRegion2"};
-
-const char* serverGroup = "ServerGroup1";
-
-char* FEOnRegionPrSHOP = (char*)"FEOnRegionPrSHOP";
-char* FEOnRegionPrSHOP_OptimizeForWrite =
- (char*)"FEOnRegionPrSHOP_OptimizeForWrite";
-char* getFuncName = (char*)"MultiGetFunction";
-char* putFuncName = (char*)"MultiPutFunction";
-char* putFuncIName = (char*)"MultiPutFunctionI";
-char* FETimeOut = (char*)"FunctionExecutionTimeOut";
-
-class MyResultCollector : public DefaultResultCollector {
- public:
- MyResultCollector()
- : m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
- ~MyResultCollector() noexcept {}
-
- std::shared_ptr<CacheableVector> getResult(
- std::chrono::milliseconds timeout) override {
- m_getResultCount++;
- return DefaultResultCollector::getResult(timeout);
- }
-
- void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
- m_addResultCount++;
- if (resultItem == nullptr) {
- return;
- }
- if (auto results =
- std::dynamic_pointer_cast<CacheableArrayList>(resultItem)) {
- for (auto& result : *results) {
- DefaultResultCollector::addResult(result);
- }
- } else {
- DefaultResultCollector::addResult(resultItem);
- }
- }
-
- void endResults() override {
- m_endResultCount++;
- DefaultResultCollector::endResults();
- }
-
- uint32_t getEndResultCount() { return m_endResultCount; }
- uint32_t getAddResultCount() { return m_addResultCount; }
- uint32_t getGetResultCount() { return m_getResultCount; }
-
- private:
- uint32_t m_endResultCount;
- uint32_t m_addResultCount;
- uint32_t m_getResultCount;
-};
-
-class MyResultCollector2 : public DefaultResultCollector {
- public:
- MyResultCollector2()
- : m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
- ~MyResultCollector2() noexcept {}
-
- std::shared_ptr<CacheableVector> getResult(std::chrono::milliseconds timeout) override {
- m_getResultCount++;
- return DefaultResultCollector::getResult(timeout);
- }
-
- void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
- m_addResultCount++;
- DefaultResultCollector::addResult(resultItem);
- }
-
- void endResults() override {
- m_endResultCount++;
- DefaultResultCollector::endResults();
- }
-
- uint32_t getEndResultCount() { return m_endResultCount; }
- uint32_t getAddResultCount() { return m_addResultCount; }
- uint32_t getGetResultCount() { return m_getResultCount; }
-
- private:
- uint32_t m_endResultCount;
- uint32_t m_addResultCount;
- uint32_t m_getResultCount;
-};
-
-DUNIT_TASK_DEFINITION(LOCATOR1, StartLocator1)
- {
- // starting locator
- if (isLocator) {
- CacheHelper::initLocator(1);
- LOG("Locator1 started");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER, StartS13)
- {
- if (isLocalServer) {
- CacheHelper::initServer(1, "func_cacheserver1_pool.xml", locHostPort);
- }
- if (isLocalServer) {
- CacheHelper::initServer(2, "func_cacheserver2_pool.xml", locHostPort);
- }
- if (isLocalServer) {
- CacheHelper::initServer(3, "func_cacheserver3_pool.xml", locHostPort);
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
- {
- initClientWithPool(true, poolRegNames[0], locHostPort, serverGroup, nullptr,
- 0, true, -1, -1, 60000, /*singlehop*/ true,
- /*threadLocal*/ true);
-
- auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
- ;
- regPtr0->registerAllKeys();
-
- LOG("Clnt1Init complete.");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
- {
- auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- char buf[128];
-
- for (int i = 0; i < 230; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
- regPtr0->put(i, value);
- }
- LOG("Put done.");
- try {
- for (int k = 0; k < 210; k++) {
- auto routingObj = CacheableVector::create();
- for (int i = k; i < k + 20; i++) {
- routingObj->push_back(CacheableInt32::create(i));
- }
- LOGINFO("routingObj size = %d ", routingObj->size());
- auto exe = FunctionService::onRegion(regPtr0);
- ASSERT(exe != nullptr, "onRegion Returned nullptr");
-
- auto resultList = CacheableVector::create();
- LOG("Executing getFuncName function");
- auto executeFunctionResult =
- exe->withFilter(routingObj)
- ->execute(getFuncName, std::chrono::seconds(15))
- ->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult->size());
- LOGINFO(buf);
- resultList->clear();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0;
- pos < static_cast<uint32_t>(arrayList->size()); pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOGINFO(buf);
- ASSERT(resultList->size() == 40,
- "get executeFunctionResult count is not 40");
- for (int32_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- }
- }
- LOGINFO("getFuncName done");
- auto myRC = std::make_shared<MyResultCollector>();
- auto executeFunctionResult1 = exe->withFilter(routingObj)
- ->withCollector(myRC)
- ->execute(getFuncName)
- ->getResult();
- LOGINFO("add result count = %d", myRC->getAddResultCount());
- LOGINFO("end result count = %d", myRC->getEndResultCount());
- LOGINFO("get result count = %d", myRC->getGetResultCount());
- ASSERT(4 == myRC->getAddResultCount(), "add result count is not 4");
- ASSERT(1 == myRC->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == myRC->getGetResultCount(), "get result count is not 1");
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "region get new collector: result is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult->size());
- LOGINFO(buf);
- resultList->clear();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0;
- pos < static_cast<uint32_t>(arrayList->size()); pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOGINFO(buf);
- ASSERT(resultList->size() == 40,
- "get executeFunctionResult count is not 40");
- for (int32_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- // sprintf(buf, "get result[%d]=%s", i,
- // std::dynamic_pointer_cast<CacheableString>(
- // resultList->operator[](i))
- // ->value().c_str());
- // LOGINFO(buf);
- }
- }
- LOGINFO("getFuncName MyResultCollector done");
-
- auto executeFunctionResult2 =
- exe->withFilter(routingObj)->execute(FEOnRegionPrSHOP)->getResult();
- if (executeFunctionResult2 == nullptr) {
- ASSERT(false, "executeFunctionResult2 is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult2->size());
- LOG(buf);
- ASSERT(2 == executeFunctionResult2->size(),
- "executeFunctionResult2 size is not 2");
- for (int i = 0; i < executeFunctionResult2->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult2->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FEOnRegionPrSHOP withFilter done");
-
- ///////////////////////// Now same with ResultCollector
- ////////////////////////////
-
- std::shared_ptr<MyResultCollector2> myRC2(new MyResultCollector2());
- auto executeFunctionResult21 = exe->withFilter(routingObj)
- ->withCollector(myRC2)
- ->execute(FEOnRegionPrSHOP)
- ->getResult();
- LOGINFO("add result count = %d", myRC2->getAddResultCount());
- LOGINFO("end result count = %d", myRC2->getEndResultCount());
- LOGINFO("get result count = %d", myRC2->getGetResultCount());
- ASSERT(2 == myRC2->getAddResultCount(), "add result count is not 2");
- ASSERT(1 == myRC2->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == myRC2->getGetResultCount(), "get result count is not 1");
- if (executeFunctionResult21 == nullptr) {
- ASSERT(false, "executeFunctionResult21 is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult21->size());
- LOG(buf);
- ASSERT(2 == executeFunctionResult21->size(),
- "executeFunctionResult21 size is not 2");
- for (int i = 0; i < executeFunctionResult21->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult21->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FEOnRegionPrSHOP done with ResultCollector withFilter");
-
- /////////////////////// Done with ResultCollector
- ////////////////////////////////
-
- auto executeFunctionResult3 =
- exe->withFilter(routingObj)
- ->execute(FEOnRegionPrSHOP_OptimizeForWrite)
- ->getResult();
- if (executeFunctionResult3 == nullptr) {
- ASSERT(false, "executeFunctionResult3 is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult3->size());
- LOG(buf);
- ASSERT(3 == executeFunctionResult3->size(),
- "executeFunctionResult3->size() is not 3");
- for (int i = 0; i < executeFunctionResult3->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult3->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FEOnRegionPrSHOP_OptimizeForWrite withFilter done");
-
- ///////////////////////// Now same with ResultCollector
- ////////////////////////////
- std::shared_ptr<MyResultCollector2> myRC3(new MyResultCollector2());
- auto executeFunctionResult31 =
- exe->withFilter(routingObj)
- ->withCollector(myRC3)
- ->execute(FEOnRegionPrSHOP_OptimizeForWrite)
- ->getResult();
- LOGINFO("add result count = %d", myRC3->getAddResultCount());
- LOGINFO("end result count = %d", myRC3->getEndResultCount());
- LOGINFO("get result count = %d", myRC3->getGetResultCount());
- ASSERT(3 == myRC3->getAddResultCount(), "add result count is not 3");
- ASSERT(1 == myRC3->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == myRC3->getGetResultCount(), "get result count is not 1");
- if (executeFunctionResult31 == nullptr) {
- ASSERT(false, "executeFunctionResult31 is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult31->size());
- LOG(buf);
- ASSERT(3 == executeFunctionResult31->size(),
- "executeFunctionResult31->size() is not 3");
- for (int i = 0; i < executeFunctionResult31->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult31->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO(
- "FEOnRegionPrSHOP_OptimizeForWrite done with ResultCollector "
- "withFilter");
- }
-
- auto exc = FunctionService::onRegion(regPtr0);
- ASSERT(exc != nullptr, "onRegion Returned nullptr");
- // Now w/o filter, chk for singlehop
- auto executeFunctionResult2 = exc->execute(FEOnRegionPrSHOP)->getResult();
- if (executeFunctionResult2 == nullptr) {
- ASSERT(false, "executeFunctionResult2 is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult2->size());
- LOG(buf);
- ASSERT(2 == executeFunctionResult2->size(),
- "executeFunctionResult2 size is not 2");
- for (int i = 0; i < executeFunctionResult2->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult2->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- executeFunctionResult2->clear();
- LOGINFO("FEOnRegionPrSHOP without Filter done");
-
- // Now w/o filter chk single hop
- std::shared_ptr<MyResultCollector2> resultCollector(new MyResultCollector2());
- auto executeFunctionResult21 = exc->withCollector(resultCollector)
- ->execute(FEOnRegionPrSHOP)
- ->getResult();
- LOGINFO("add result count = %d", resultCollector->getAddResultCount());
- LOGINFO("end result count = %d", resultCollector->getEndResultCount());
- LOGINFO("get result count = %d", resultCollector->getGetResultCount());
- ASSERT(2 == resultCollector->getAddResultCount(),
- "add result count is not 2");
- ASSERT(1 == resultCollector->getEndResultCount(),
- "end result count is not 1");
- ASSERT(1 == resultCollector->getGetResultCount(),
- "get result count is not 1");
- if (executeFunctionResult21 == nullptr) {
- ASSERT(false, "executeFunctionResult21 is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult21->size());
- LOG(buf);
- ASSERT(2 == executeFunctionResult21->size(),
- "executeFunctionResult21 size is not 2");
- for (int i = 0; i < executeFunctionResult21->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult21->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FEOnRegionPrSHOP done with ResultCollector without filter");
-
- // Now w/o filter chk for singleHop
- std::shared_ptr<MyResultCollector2> rC(new MyResultCollector2());
- auto executeFunctionResult31 =
- exc->withCollector(rC)
- ->execute(FEOnRegionPrSHOP_OptimizeForWrite)
- ->getResult();
- LOGINFO("add result count = %d", rC->getAddResultCount());
- LOGINFO("end result count = %d", rC->getEndResultCount());
- LOGINFO("get result count = %d", rC->getGetResultCount());
- ASSERT(3 == rC->getAddResultCount(), "add result count is not 3");
- ASSERT(1 == rC->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == rC->getGetResultCount(), "get result count is not 1");
- if (executeFunctionResult31 == nullptr) {
- ASSERT(false, "executeFunctionResult31 is nullptr");
- } else {
- sprintf(buf, "result count = %zd", executeFunctionResult31->size());
- LOG(buf);
- ASSERT(3 == executeFunctionResult31->size(),
- "executeFunctionResult31->size() is not 3");
- for (int i = 0; i < executeFunctionResult31->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult31->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO(
- "FEOnRegionPrSHOP_OptimizeForWrite done with ResultCollector without "
- "Filter.");
-
- // Now w/o filter chk for singleHop
- auto functionResult =
- exc->execute(FEOnRegionPrSHOP_OptimizeForWrite)->getResult();
- if (functionResult == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", functionResult->size());
- LOG(buf);
- ASSERT(3 == functionResult->size(), "FunctionResult->size() is not 3");
- for (int i = 0; i < functionResult->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- functionResult->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FEOnRegionPrSHOP_OptimizeForWrite without Filter done");
- /////////////////////// Done with ResultCollector
- ////////////////////////////////
-
- char KeyStr[256] = {0};
- char valStr[256] = {0};
- auto fil = CacheableVector::create();
- for (int i = 0; i < 500; i++) {
- ACE_OS::snprintf(KeyStr, 256, "KEY--%d ", i);
- ACE_OS::snprintf(valStr, 256, "VALUE--%d ", i);
- auto keyport = CacheableString::create(KeyStr);
- auto valport = CacheableString::create(valStr);
- regPtr0->put(keyport, valport);
- fil->push_back(CacheableString::create(KeyStr));
- }
- LOGINFO("Put on region complete ");
- LOGINFO("filter count= {0}.", fil->size());
-
- // Fire N Forget with filter keys
- exc->withFilter(fil)->execute(putFuncName);
- SLEEP(4000);
- LOGINFO(
- "Executing ExecuteFunctionOnRegion on region for execKeys for "
- "arrList "
- "arguement done.");
- for (int i = 0; i < fil->size(); i++) {
- auto str = std::dynamic_pointer_cast<CacheableString>(fil->at(i));
- auto val =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(str));
- LOGINFO("Filter Key = %s , get Value = %s ", str->value().c_str(),
- val->value().c_str());
- if (strcmp(str->value().c_str(), val->value().c_str()) != 0) {
- ASSERT(false, "Value after function execution is incorrect");
- }
- }
-
- // Fire N Forget without filter keys
- auto arrList = CacheableArrayList::create();
- for (int i = 10; i < 200; i++) {
- ACE_OS::snprintf(KeyStr, 256, "KEY--%d ", i);
- arrList->push_back(CacheableString::create(KeyStr));
- }
- auto ex = FunctionService::onRegion(regPtr0);
- ex->withArgs(arrList)->execute(putFuncIName);
- LOGINFO(
- "Executing ExecuteFunctionOnRegion on region for execKeys for "
- "arrList "
- "arguement done.");
- SLEEP(4000);
- for (int i = 0; i < arrList->size(); i++) {
- auto str = std::dynamic_pointer_cast<CacheableString>(arrList->at(i));
- auto val =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(str));
- LOGINFO("Filter Key = %s ", str->value().c_str());
- LOGINFO("get Value = %s ", val->value().c_str());
- if (strcmp(str->value().c_str(), val->value().c_str()) != 0) {
- ASSERT(false, "Value after function execution is incorrect");
- }
- }
-
- ///////////////////TimeOut test //////////////////////
- LOGINFO("FETimeOut begin onRegion");
- auto timeout = std::chrono::milliseconds(15000);
- auto RexecutionPtr = FunctionService::onRegion(regPtr0);
- auto fe = RexecutionPtr->withArgs(CacheableInt32::create(timeout.count()))
- ->execute(FETimeOut, timeout)
- ->getResult();
- if (fe == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", fe->size());
- LOG(buf);
- ASSERT(2 == fe->size(), "FunctionResult->size() is not 2");
- for (int i = 0; i < fe->size(); i++) {
- bool b =
- std::dynamic_pointer_cast<CacheableBoolean>(fe->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FETimeOut done onRegion");
- } catch (const Exception& excp) {
- std::string logmsg = "";
- logmsg += excp.getName();
- logmsg += ": ";
- logmsg += excp.what();
- LOG(logmsg.c_str());
- LOG(excp.getStackTrace());
- FAIL("Function Execution Failed!");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, StopC1)
- {
- cleanProc();
- LOG("Clnt1Down complete: ");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER, CloseServers)
- {
- // stop servers
- if (isLocalServer) {
- CacheHelper::closeServer(1);
- LOG("SERVER1 stopped");
- }
- if (isLocalServer) {
- CacheHelper::closeServer(2);
- LOG("SERVER2 stopped");
- }
- if (isLocalServer) {
- CacheHelper::closeServer(3);
- LOG("SERVER3 stopped");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(LOCATOR1, CloseLocator1)
- {
- // stop locator
- if (isLocator) {
- CacheHelper::closeLocator(1);
- LOG("Locator1 stopped");
- }
- }
-END_TASK_DEFINITION
-
-void runFunctionExecution() {
- CALL_TASK(StartLocator1);
- CALL_TASK(StartS13);
- CALL_TASK(StartC1);
- CALL_TASK(Client1OpTest2);
- CALL_TASK(StopC1);
- CALL_TASK(CloseServers);
- CALL_TASK(CloseLocator1);
-}
-
-DUNIT_MAIN
- { runFunctionExecution(); }
-END_MAIN
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
deleted file mode 100644
index 539c048..0000000
--- a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
+++ /dev/null
@@ -1,1244 +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 "fw_dunit.hpp"
-#include "ThinClientHelper.hpp"
-#include "testobject/VariousPdxTypes.hpp"
-
-#include <ace/OS.h>
-#include <ace/High_Res_Timer.h>
-#include <ace/ACE.h>
-
-#include <geode/PdxInstanceFactory.hpp>
-#include <geode/UserFunctionExecutionException.hpp>
-#include <geode/FunctionService.hpp>
-#include <geode/DefaultResultCollector.hpp>
-using namespace PdxTests;
-/* This is to test
-1- funtion execution on pool
-*/
-
-#define CLIENT1 s1p1
-#define CLIENT2 s1p2
-#define LOCATOR1 s2p1
-#define SERVER s2p2
-
-bool isLocalServer = false;
-bool isLocator = false;
-bool isPoolWithEndpoint = false;
-
-const char* locHostPort =
- CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-const char* poolRegNames[] = {"partition_region", "PoolRegion2"};
-
-const char* serverGroup = "ServerGroup1";
-
-char* getFuncIName = (char*)"MultiGetFunctionI";
-char* putFuncIName = (char*)"MultiPutFunctionI";
-char* getFuncName = (char*)"MultiGetFunction";
-char* getFuncName2 = (char*)"MultiGetFunction2";
-char* putFuncName = (char*)"MultiPutFunction";
-char* rjFuncName = (char*)"RegionOperationsFunction";
-char* exFuncName = (char*)"ExceptionHandlingFunction";
-char* exFuncNameSendException = (char*)"executeFunction_SendException";
-char* exFuncNamePdxType = (char*)"PdxFunctionTest";
-char* FETimeOut = (char*)"FunctionExecutionTimeOut";
-
-#define verifyGetResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "VALUE--%d", j); \
- if (strcmp(buf, std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()) == 0) { \
- LOGINFO( \
- "buf = %s " \
- "std::dynamic_pointer_cast<CacheableString>(resultList->operator[](" \
- "i))->value().c_str() " \
- "= %s ", \
- buf, \
- std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()); \
- found = true; \
- break; \
- } \
- } \
- ASSERT(found, "this returned value is invalid");
-
-#define verifyGetKeyResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "KEY--%d", j); \
- if (strcmp(buf, std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()) == 0) { \
- LOGINFO( \
- "buf = %s " \
- "std::dynamic_pointer_cast<CacheableString>(resultList->operator[](" \
- "i))->value().c_str() " \
- "= %s ", \
- buf, \
- std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()); \
- found = true; \
- break; \
- } \
- } \
- ASSERT(found, "this returned KEY is invalid");
-
-#define verifyPutResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "KEY--%d", j); \
- if (strcmp(buf, value->value().c_str()) == 0) { \
- found = true; \
- break; \
- } \
- } \
- ASSERT(found, "this returned value is invalid");
-
-class MyResultCollector : public DefaultResultCollector {
- public:
- MyResultCollector()
- : DefaultResultCollector(),
- m_endResultCount(0),
- m_addResultCount(0),
- m_getResultCount(0) {}
- ~MyResultCollector() override = default;
-
- std::shared_ptr<CacheableVector> getResult(
- std::chrono::milliseconds timeout) override {
- m_getResultCount++;
- return DefaultResultCollector::getResult(timeout);
- }
-
- void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
- m_addResultCount++;
- if (resultItem == nullptr) {
- return;
- }
- if (auto results =
- std::dynamic_pointer_cast<CacheableArrayList>(resultItem)) {
- for (auto& result : *results) {
- DefaultResultCollector::addResult(result);
- }
- } else {
- DefaultResultCollector::addResult(resultItem);
- }
- }
-
- void endResults() override {
- m_endResultCount++;
- DefaultResultCollector::endResults();
- }
-
- uint32_t getEndResultCount() { return m_endResultCount; }
- uint32_t getAddResultCount() { return m_addResultCount; }
- uint32_t getGetResultCount() { return m_getResultCount; }
-
- private:
- uint32_t m_endResultCount;
- uint32_t m_addResultCount;
- uint32_t m_getResultCount;
-};
-
-template <class _T>
-bool validateResultTypeAndAllowUserFunctionExecutionException(
- const int32_t index, const std::shared_ptr<Cacheable>& result) {
- if (auto intValue = std::dynamic_pointer_cast<_T>(result)) {
- LOGINFO("%s is %d ", typeid(_T).name(), intValue->value());
- return true;
- } else {
- if (auto uFEPtr =
- std::dynamic_pointer_cast<UserFunctionExecutionException>(result)) {
- LOGINFO("Done casting to uFEPtr");
- LOGINFO("Read expected uFEPtr exception %s ",
- uFEPtr->getMessage().c_str());
- return true;
- } else {
- LOGINFO("Unexpected result type %s for index %d.",
- result->toString().c_str(), index);
- }
- }
-
- return false;
-}
-
-bool validateResultTypeIsUserFunctionExecutionException(
- const int32_t index, const std::shared_ptr<Cacheable>& result) {
- if (auto uFEPtr =
- std::dynamic_pointer_cast<UserFunctionExecutionException>(result)) {
- LOGINFO("Done casting to uFEPtr");
- LOGINFO("Read expected uFEPtr exception %s ", uFEPtr->getMessage().c_str());
- return true;
- } else {
- LOGINFO("Unexpected result type %s for index %d.",
- result->toString().c_str(), index);
- }
-
- return false;
-}
-
-template <class _T>
-bool validateResultType(const int32_t index, const std::shared_ptr<Cacheable>& result) {
- return false;
-}
-
-DUNIT_TASK_DEFINITION(LOCATOR1, StartLocator1)
- {
- // starting locator
- if (isLocator) {
- CacheHelper::initLocator(1);
- LOG("Locator1 started");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER, StartS12)
- {
- const char* lhp = nullptr;
- if (!isPoolWithEndpoint) lhp = locHostPort;
- if (isLocalServer) {
- CacheHelper::initServer(1, "func_cacheserver1_pool.xml", lhp);
- }
- if (isLocalServer) {
- CacheHelper::initServer(2, "func_cacheserver2_pool.xml", lhp);
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER, startServer2)
- {
- const char* lhp = nullptr;
- if (!isPoolWithEndpoint) lhp = locHostPort;
- if (isLocalServer) {
- CacheHelper::initServer(2, "func_cacheserver2_pool.xml", lhp);
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
- {
- initClientWithPool(true, poolRegNames[0], locHostPort, serverGroup, nullptr,
- 0, true);
-
- auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
- regPtr0->registerAllKeys();
-
- LOG("Clnt1Init complete.");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
- {
- auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- char buf[128];
-
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
-
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableString::create(buf);
- regPtr0->put(key, value);
- }
- SLEEP(10000); // let the put finish
- try {
- std::shared_ptr<Cacheable> args = CacheableBoolean::create(1);
- auto routingObj = CacheableVector::create();
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- routingObj->push_back(key);
- }
-
- // test data dependant function
- // test get function with result
- auto exc = FunctionService::onRegion(regPtr0);
- ASSERT(exc != nullptr, "onRegion Returned nullptr");
- args = CacheableKey::create("echoString");
- std::shared_ptr<Cacheable> args1 = CacheableKey::create("echoBoolean");
- auto exe1 = exc->withArgs(args);
- auto exe2 = exe1->withArgs(args1);
-
- auto resultList = CacheableVector::create();
- auto executeFunctionResult =
- exe1->execute(rjFuncName, std::chrono::seconds(15))->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "echo String : executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo String : result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- if (auto csp = std::dynamic_pointer_cast<CacheableString>(
- executeFunctionResult->operator[](0))) {
- sprintf(buf, "echo String : cast successful, echoed string= %s",
- csp->value().c_str());
- LOG(buf);
- } else {
- FAIL("echo String : wrong argument type");
- }
- }
- executeFunctionResult =
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(exFuncName, std::chrono::seconds(15))
- ->getResult();
-
- executeFunctionResult =
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(rjFuncName, std::chrono::seconds(15))
- ->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "echo String : executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo String : result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- const char* str = std::dynamic_pointer_cast<CacheableString>(
- executeFunctionResult->operator[](0))
- ->value()
- .c_str();
- LOG(str);
- ASSERT(strcmp("echoString", str) == 0, "echoString is not eched back");
- }
- args = CacheableKey::create("echoBoolean");
- executeFunctionResult =
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(rjFuncName, std::chrono::seconds(15))
- ->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "echo Boolean: executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo Boolean: result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult->operator[](0))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
-
- executeFunctionResult = exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(getFuncName)
- ->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "region get: executeFunctionResult is nullptr");
- } else {
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "Region get: result count = %zd", resultList->size());
- LOG(buf);
- ASSERT(resultList->size() == 34,
- "region get: resultList count is not 34");
- for (int32_t i = 0; i < resultList->size(); i++) {
- auto csPtr = std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i));
- // printf(" in csPtr = %u \n",csPtr);
- if (csPtr != nullptr) {
- sprintf(buf, "Region get: result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- } else {
- std::shared_ptr<Cacheable> tmp = resultList->operator[](i);
- if (tmp != nullptr) {
- printf(" in typeid = %d \n", tmp->typeId());
-
- } else {
- printf(" in typeid is null \n");
- }
- }
- }
- }
- // test get function with customer collector
- auto myRC = std::make_shared<MyResultCollector>();
- executeFunctionResult = exc->withFilter(routingObj)
- ->withArgs(args)
- ->withCollector(myRC)
- ->execute(getFuncName)
- ->getResult();
- sprintf(buf, "add result count = %d", myRC->getAddResultCount());
- LOG(buf);
- sprintf(buf, "end result count = %d", myRC->getEndResultCount());
- LOG(buf);
- sprintf(buf, "get result count = %d", myRC->getGetResultCount());
- LOG(buf);
- if (executeFunctionResult == nullptr) {
- ASSERT(false,
- "region get new collector: executeFunctionResult is nullptr");
- } else {
- resultList->clear();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- resultList->push_back(executeFunctionResult->operator[](item));
- }
- sprintf(buf, "Region get new collector: result list count = %zd",
- resultList->size());
- LOG(buf);
- sprintf(buf, "Region get new collector: result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- ASSERT(
- executeFunctionResult->size() == resultList->size(),
- "region get new collector: executeFunctionResult count is not 34");
- for (int32_t i = 0; i < executeFunctionResult->size(); i++) {
- sprintf(buf, "Region get new collector: result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- }
- }
- // test put function without result
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(putFuncName, std::chrono::seconds(15));
- SLEEP(10000); // let the put finish
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- auto value =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
- sprintf(buf, "Region put: result[%d]=%s", i, value->value().c_str());
- LOG(buf);
- verifyPutResults()
- }
-
- args = routingObj;
- executeFunctionResult =
- exc->withArgs(args)
- ->withFilter(routingObj)
- ->execute(getFuncName, std::chrono::seconds(15))
- ->getResult();
-
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "get executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo String : result count = %zd",
- executeFunctionResult->size());
- LOGINFO(buf);
- resultList->clear();
-
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOGINFO(buf);
- ASSERT(resultList->size() == 34,
- "get executeFunctionResult count is not 34");
- for (int32_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- sprintf(buf, "get result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOGINFO(buf);
- verifyGetKeyResults()
- }
- }
-
- //-----------------------Test with sendException
- // onRegion-------------------------------//
- for (int i = 1; i <= 200; i++) {
- auto value = CacheableInt32::create(i);
-
- sprintf(buf, "execKey-%d", i);
- auto key = CacheableKey::create(buf);
- regPtr0->put(key, value);
- }
- LOG("Put for execKey's on region complete.");
-
- LOG("Adding filter");
- auto arrList = CacheableArrayList::create();
- for (int i = 100; i < 120; i++) {
- sprintf(buf, "execKey-%d", i);
- auto key = CacheableKey::create(buf);
- arrList->push_back(key);
- }
-
- auto filter = CacheableVector::create();
- for (int i = 100; i < 120; i++) {
- sprintf(buf, "execKey-%d", i);
- auto key = CacheableKey::create(buf);
- filter->push_back(key);
- }
- LOG("Adding filter done.");
-
- args = CacheableBoolean::create(1);
-
- auto funcExec = FunctionService::onRegion(regPtr0);
- ASSERT(funcExec != nullptr, "onRegion Returned nullptr");
-
- auto collector = funcExec->withArgs(args)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onRegion collector nullptr");
-
- auto result = collector->getResult();
-
- if (result == nullptr) {
- ASSERT(false, "echo String : result is nullptr");
- } else {
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for bool "
- "arguement exception.");
- }
- }
- LOG("exFuncNameSendException done for bool arguement.");
-
- collector = funcExec->withArgs(arrList)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onRegion collector for arrList nullptr");
-
- result = collector->getResult();
- LOGINFO("result->size() = %d & arrList->size() = %d ", result->size(),
- arrList->size() + 1);
- ASSERT(
- result->size() == arrList->size() + 1,
- "region get: resultList count is not as arrayList count + exception");
-
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeAndAllowUserFunctionExecutionException<
- CacheableInt32>(i, result->operator[](i)),
- "Unexpected result type.");
- }
-
- LOG("exFuncNameSendException done for arrayList arguement.");
-
- LOG("exFuncNameSendException for string arguement.");
-
- args = CacheableString::create("Multiple");
- collector = funcExec->withArgs(args)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onRegion collector for string nullptr");
- result = collector->getResult();
- LOGINFO("result->size() for Multiple String = %d ", result->size());
- ASSERT(result->size() == 1,
- "region get: resultList count is not as string exception");
-
- for (int i = 0; i < result->size(); i++) {
- LOG("exFuncNameSendException now casting to "
- "UserFunctionExecutionExceptionPtr for arrayList arguement "
- "exception.");
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for string "
- "arguement exception.");
- }
-
- LOG("exFuncNameSendException for string arguement done.");
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement using onRegion.");
-
- auto myRC1 = std::make_shared<MyResultCollector>();
- result = funcExec->withArgs(args)
- ->withFilter(filter)
- ->withCollector(myRC1)
- ->execute(exFuncNameSendException)
- ->getResult();
- LOGINFO("add result count = %d", myRC1->getAddResultCount());
- LOGINFO("end result count = %d", myRC1->getEndResultCount());
- LOGINFO("get result count = %d", myRC1->getGetResultCount());
- ASSERT(1 == myRC1->getAddResultCount(), "add result count is not 1");
- ASSERT(1 == myRC1->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == myRC1->getGetResultCount(), "get result count is not 1");
- if (result == nullptr) {
- ASSERT(false, "region get new collector: result is nullptr");
- } else {
- LOGINFO("Region get new collector: result count = %d", result->size());
- ASSERT(1 == result->size(),
- "region get new collector: result count is not 1");
- }
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement done using onRegion.");
-
- //-----------------------Test with sendException onRegion
- // done-------------------------------//
-
- // restore the data set
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
-
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableString::create(buf);
- regPtr0->put(key, value);
- }
-
- // test data independant function
- // test get function with result
- args = routingObj;
-
- // test data independant function on one server
- LOG("test data independant get function on one server");
- exc = FunctionService::onServer(getHelper()->cachePtr);
- executeFunctionResult =
- exc->withArgs(args)->execute(getFuncIName)->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "get executeFunctionResult is nullptr");
- } else {
- resultList->clear();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOG(buf);
- ASSERT(resultList->size() == 17,
- "get executeFunctionResult count is not 17");
- for (int32_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- sprintf(buf, "get result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- }
- }
- LOG("test data independant put function on one server");
- // test put function without result
- exc->withArgs(args)->execute(putFuncIName, std::chrono::seconds(15));
- SLEEP(500); // let the put finish
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- auto value =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
- sprintf(buf, "put: result[%d]=%s", i, value->value().c_str());
- LOG(buf);
- verifyPutResults()
- }
- LOG("test data independant get function on all servers");
- // test data independant function on all servers
- // test get
-
- //-----------------------Test with PdxObject
- // onServers-------------------------------//
-
- try {
- auto serializationRegistry =
- CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
- ->getSerializationRegistry();
- serializationRegistry->addPdxType(
- PdxTests::PdxTypes8::createDeserializable);
- } catch (const IllegalStateException&) {
- // ignore exception
- }
-
- auto pdxobj = std::make_shared<PdxTests::PdxTypes8>();
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- regPtr0->put(key, pdxobj);
- }
- LOGINFO("put on pdxObject done");
-
- auto pdxRoutingObj = CacheableVector::create();
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- pdxRoutingObj->push_back(key);
- }
-
- auto pdxExc = FunctionService::onServers(getHelper()->cachePtr);
- auto executeFunctionResultPdx = pdxExc->withArgs(pdxRoutingObj)
- ->execute(exFuncNamePdxType)
- ->getResult();
- LOGINFO("FE on pdxObject done");
- if (executeFunctionResultPdx == nullptr) {
- ASSERT(false, "get executeFunctionResultPdx is nullptr");
- } else {
- LOGINFO("executeFunctionResultPdx size for PdxObject = %d ",
- executeFunctionResultPdx->size());
- ASSERT(2 == executeFunctionResultPdx->size(),
- "executeFunctionResultPdx->size() is not 2");
- auto resultListPdx = CacheableVector::create();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResultPdx->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResultPdx->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultListPdx->push_back(arrayList->operator[](pos));
- }
- }
- LOGINFO("resultlistPdx size: %d", resultListPdx->size());
- for (int32_t i = 0; i < resultListPdx->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultListPdx->operator[](i) != nullptr, buf);
- LOG("resultPdx item is not null");
- LOGINFO(
- "get result[%d]=%s", i,
- std::dynamic_pointer_cast<PdxTypes8>(resultListPdx->operator[](i))
- ->toString()
- .c_str());
- auto pdxObj2 = std::dynamic_pointer_cast<PdxTypes8>(
- resultListPdx->operator[](i));
- ASSERT(pdxobj->equals(pdxObj2) == true,
- "Pdx Object not equals original object.");
- }
- }
- LOG("test pdx data function on all servers done");
-
- auto pifPtr = cacheHelper->getCache()->createPdxInstanceFactory(
- "PdxTests.PdxTypes8");
- LOG("PdxInstanceFactoryPtr created....");
-
- pifPtr->writeInt("i1", 1);
- pifPtr->writeInt("i2", 2);
- pifPtr->writeString("s1", "m_s1");
- pifPtr->writeString("s2", "m_s2");
- pifPtr->writeInt("i3", 3);
- pifPtr->writeInt("i4", 4);
-
- auto ret = pifPtr->create();
- LOG("PdxInstancePtr created");
-
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- regPtr0->put(key, pdxobj);
- }
- LOGINFO("put on pdxObject done");
-
- auto pdxInstanceRoutingObj = CacheableVector::create();
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- pdxInstanceRoutingObj->push_back(key);
- }
-
- auto pdxInstanceExc = FunctionService::onServers(getHelper()->cachePtr);
- auto executeFunctionResultPdxInstance =
- pdxInstanceExc->withArgs(pdxInstanceRoutingObj)
- ->execute(exFuncNamePdxType)
- ->getResult();
- LOGINFO("FE on pdxObject done");
- if (executeFunctionResultPdxInstance == nullptr) {
- ASSERT(false, "get executeFunctionResultPdxInstance is nullptr");
- } else {
- LOGINFO("executeFunctionResultPdxInstance size for PdxObject = %d ",
- executeFunctionResultPdxInstance->size());
- ASSERT(2 == executeFunctionResultPdx->size(),
- "executeFunctionResultPdxInstance->size() is not 2");
- auto resultListPdxInstance = CacheableVector::create();
- for (unsigned item = 0;
- item <
- static_cast<uint32_t>(executeFunctionResultPdxInstance->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResultPdxInstance->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultListPdxInstance->push_back(arrayList->operator[](pos));
- }
- }
- LOGINFO("resultlistPdxInstance size: %d",
- resultListPdxInstance->size());
- for (int32_t i = 0; i < resultListPdxInstance->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultListPdxInstance->operator[](i) != nullptr, buf);
- LOG("resultPdx item is not null");
- LOGINFO("get result[%d]=%s", i,
- std::dynamic_pointer_cast<PdxTypes8>(
- resultListPdxInstance->operator[](i))
- ->toString()
- .c_str());
- auto pdxObj2 = std::dynamic_pointer_cast<PdxTypes8>(
- resultListPdxInstance->operator[](i));
-
- ASSERT(pdxobj->equals(pdxObj2) == true,
- "Pdx Object not equals original object.");
- }
- }
- LOG("test pdx data function on all servers done");
-
- //-----------------------Test with PdxObject onServers
- // done.-------------------------------//
-
- // repopulate with the original values
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
-
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableString::create(buf);
- regPtr0->put(key, value);
- }
- SLEEP(10000); // let the put finish
- //---------------------------------------------------------------------
- // adding one more server, this should be return by locator and then
- // function should be executed on all the 3 servers
-
- const char* lhp = nullptr;
- if (!isPoolWithEndpoint) lhp = locHostPort;
-
- if (isLocalServer) {
- CacheHelper::initServer(3, "func_cacheserver3_pool.xml", lhp);
- }
- LOGINFO("Sleeping for 60s...");
- SLEEP(60000); // let this servers gets all the data
-
- //---------------------------------------------------------------------
- exc = FunctionService::onServers(getHelper()->cachePtr);
- executeFunctionResult =
- exc->withArgs(args)->execute(getFuncIName)->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "get executeFunctionResult is nullptr");
- } else {
- resultList->clear();
- for (auto&& result : *executeFunctionResult) {
- for (auto&& entry :
- *std::dynamic_pointer_cast<CacheableArrayList>(result)) {
- resultList->push_back(entry);
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOG(buf);
- printf("resultlist size: %zd", resultList->size());
- ASSERT(resultList->size() == 51,
- "get executeFunctionResult on all servers count is not 51");
- for (size_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%zd] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- sprintf(buf, "get result[%zd]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- }
- }
- LOG("test data independant put function on all servers");
- // test data independant function on all servers
- // test put
- exc->withArgs(args)->execute(putFuncIName, std::chrono::seconds(15));
- SLEEP(10000); // let the put finish
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- auto value =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
- sprintf(buf, "put: result[%d]=%s", i, value->value().c_str());
- LOG(buf);
- verifyPutResults()
- }
- //-----------------------Test with sendException
- // onServers-------------------------------//
- LOG("OnServers with sendException");
- args = CacheableBoolean::create(1);
- funcExec = FunctionService::onServers(getHelper()->cachePtr);
-
- collector = funcExec->withArgs(args)->execute(exFuncNameSendException,
- std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onServers collector for bool nullptr");
-
- result = collector->getResult();
- ASSERT(result->size() == 3,
- "Should have got 3 exception strings for sendException.");
- if (result == nullptr) {
- ASSERT(false, "echo String : result is nullptr");
- } else {
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for bool arguement "
- "Unknown exception.");
- }
- }
-
- collector = funcExec->withArgs(arrList)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onServers collector for arrList nullptr");
-
- result = collector->getResult();
- ASSERT(result->size() == (arrList->size() + 1) * 3,
- "onServers get: resultList count is not as arrayList count + "
- "exception");
-
- LOG("Printing only string exception results for onServers with "
- "sendException");
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeAndAllowUserFunctionExecutionException<
- CacheableInt32>(i, result->operator[](i)),
- "Unexpected result type.");
- }
-
- LOG("Printing all results for onServers with sendException");
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeAndAllowUserFunctionExecutionException<
- CacheableInt32>(i, result->operator[](i)),
- "Unexpected result type.");
- }
-
- LOG("exFuncNameSendException for string arguement.");
-
- args = CacheableString::create("Multiple");
- collector = funcExec->withArgs(args)->execute(exFuncNameSendException,
- std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onServers collector for string nullptr");
-
- result = collector->getResult();
- ASSERT(result->size() == 3,
- "region get: resultList count is not as string exception");
-
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for string arguement "
- "exception.");
- }
-
- LOG("exFuncNameSendException for string arguement done.");
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement using onServers.");
-
- auto myRC2 = std::make_shared<MyResultCollector>();
- result = funcExec->withArgs(args)
- ->withCollector(myRC2)
- ->execute(exFuncNameSendException)
- ->getResult();
- ASSERT(3 == myRC2->getAddResultCount(), "add result count is not 3");
- ASSERT(1 == myRC2->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == myRC2->getGetResultCount(), "get result count is not 1");
- LOGINFO("add result count = %d", myRC2->getAddResultCount());
- LOGINFO("end result count = %d", myRC2->getEndResultCount());
- LOGINFO("get result count = %d", myRC2->getGetResultCount());
- if (result == nullptr) {
- ASSERT(false, "region get new collector: result is nullptr");
- } else {
- LOGINFO("Region get new collector: result count = %d", result->size());
- ASSERT(3 == result->size(),
- "region get new collector: result count is not 1");
- }
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement done using onServers.");
-
- LOG("OnServers with sendException done");
-
- //-----------------------Test with sendException onServers
- // done.-------------------------------//
- } catch (const Exception& excp) {
- std::string logmsg = "";
- logmsg += excp.getName();
- logmsg += ": ";
- logmsg += excp.what();
- LOG(logmsg.c_str());
- LOG(excp.getStackTrace());
- FAIL("Function Execution Failed!");
- }
- isPoolWithEndpoint = true;
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, StopC1)
- {
- cleanProc();
- LOG("Clnt1Down complete: Keepalive = True");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, Client2OpTest)
- {
- std::chrono::milliseconds timeout = std::chrono::seconds{15};
- auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- char buf[128];
- SLEEP(10000);
- try {
- LOGINFO("FETimeOut begin onRegion");
- auto RexecutionPtr = FunctionService::onRegion(regPtr0);
- auto fe = RexecutionPtr->withArgs(CacheableInt32::create(timeout.count()))
- ->execute(FETimeOut, timeout)
- ->getResult();
- if (fe == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", fe->size());
- LOG(buf);
- for (int i = 0; i < fe->size(); i++) {
- bool b =
- std::dynamic_pointer_cast<CacheableBoolean>(fe->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FETimeOut done onRegion");
-
- LOGINFO("FETimeOut begin onServer");
- auto serverExc = FunctionService::onServer(getHelper()->cachePtr);
- auto vec = serverExc->withArgs(CacheableInt32::create(timeout.count()))
- ->execute(FETimeOut, timeout)
- ->getResult();
- if (vec == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", vec->size());
- LOG(buf);
- for (int i = 0; i < vec->size(); i++) {
- bool b =
- std::dynamic_pointer_cast<CacheableBoolean>(vec->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FETimeOut done onServer");
-
- LOGINFO("FETimeOut begin onServers");
- auto serversExc = FunctionService::onServers(getHelper()->cachePtr);
- auto vecs = serversExc->withArgs(CacheableInt32::create(timeout.count()))
- ->execute(FETimeOut, timeout)
- ->getResult();
- if (vecs == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", vecs->size());
- LOG(buf);
- for (int i = 0; i < vecs->size(); i++) {
- bool b =
- std::dynamic_pointer_cast<CacheableBoolean>(vecs->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FETimeOut done onServers");
- } catch (const Exception& excp) {
- std::string logmsg = "";
- logmsg += excp.getName();
- logmsg += ": ";
- logmsg += excp.what();
- LOG(logmsg.c_str());
- LOG(excp.getStackTrace());
- FAIL("Function Execution Failed!");
- }
- isPoolWithEndpoint = true;
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER, CloseServers)
- {
- // stop servers
- if (isLocalServer) {
- CacheHelper::closeServer(1);
- LOG("SERVER1 stopped");
- }
- if (isLocalServer) {
- CacheHelper::closeServer(2);
- LOG("SERVER2 stopped");
- }
- if (isLocalServer) {
- CacheHelper::closeServer(3);
- LOG("SERVER3 stopped");
- }
- isPoolWithEndpoint = true;
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(LOCATOR1, CloseLocator1)
- {
- // stop locator
- if (isLocator) {
- CacheHelper::closeLocator(1);
- LOG("Locator1 stopped");
- }
- }
-END_TASK_DEFINITION
-
-class putThread : public ACE_Task_Base {
- private:
- std::shared_ptr<Region> regPtr;
- int m_min;
- int m_max;
- int m_failureCount;
- int m_timeoutCount;
- volatile bool m_stop;
-
- public:
- putThread(std::shared_ptr<Region> rp, int min, int max, bool isWarmUpTask)
- : regPtr(rp),
- m_min(min),
- m_max(max),
- m_failureCount(0),
- m_timeoutCount(0),
- m_stop(false) {}
-
- int getFailureCount() { return m_failureCount; }
-
- int getTimeoutCount() { return m_timeoutCount; }
-
- int svc(void) {
- std::shared_ptr<Cacheable> args = nullptr;
- std::shared_ptr<ResultCollector> rPtr = nullptr;
- auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- while (!m_stop) {
- for (int i = m_min; i < m_max; i++) {
- try {
- char buf[128];
- sprintf(buf, "am-%d", i);
- auto key = CacheableKey::create(buf);
- auto routingObj = CacheableVector::create();
- routingObj->push_back(key);
- auto exc = FunctionService::onRegion(regPtr0);
- exc->execute(routingObj, args, rPtr, getFuncName2,
- std::chrono::seconds(300))
- ->getResult();
- } catch (const TimeoutException& te) {
- LOGINFO("Timeout exception occurred %s", te.what());
- m_timeoutCount++;
- } catch (const Exception&) {
- LOG("Exception occurred");
- } catch (...) {
- LOG("Random Exception occurred");
- }
- }
- }
- LOG("PutThread done");
- return 0;
- }
- void start() { activate(); }
- void stop() {
- m_stop = true;
- wait();
- }
-};
-
-void executeFunction() {
- auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- TestUtils::getCacheImpl(getHelper()->cachePtr)->getAndResetNetworkHopFlag();
-std::shared_ptr<Cacheable> args = nullptr;
-std::shared_ptr<ResultCollector> rPtr = nullptr;
- int failureCount = 0;
- LOGINFO("executeFunction started");
- for (int i = 0; i < 300; i++) {
- LOGINFO("executeFunction %d ", i);
- bool networkhop = TestUtils::getCacheImpl(getHelper()->cachePtr)
- ->getAndResetNetworkHopFlag();
- if (networkhop) {
- failureCount++;
- }
- char buf[128];
- sprintf(buf, "am-%d", i);
- auto key = CacheableKey::create(buf);
- auto routingObj = CacheableVector::create();
- routingObj->push_back(key);
- auto exc = FunctionService::onRegion(regPtr0);
- exc->execute(routingObj, args, rPtr, getFuncName2,
- std::chrono::seconds(300))
- ->getResult();
- }
- LOGINFO("executeFunction failureCount %d", failureCount);
- ASSERT(failureCount <= 10 && failureCount > 0, "failureCount should be zero");
-}
-
-DUNIT_TASK_DEFINITION(CLIENT1, closeServer2)
- {
- // stop servers
- if (isLocalServer) {
- CacheHelper::closeServer(2);
- LOG("SERVER2 stopped");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, closeServer1)
- {
- // stop servers
- if (isLocalServer) {
- CacheHelper::closeServer(1);
- LOG("SERVER1 stopped");
- }
- }
-END_TASK_DEFINITION
-
-void runFunctionExecution() {
- CALL_TASK(StartLocator1);
- CALL_TASK(StartS12);
- CALL_TASK(StartC1);
- CALL_TASK(Client1OpTest);
- CALL_TASK(Client2OpTest);
- CALL_TASK(StopC1);
- CALL_TASK(CloseServers);
- CALL_TASK(CloseLocator1);
-}
-
-DUNIT_MAIN
- { runFunctionExecution(); }
-END_MAIN
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
deleted file mode 100644
index f7236ec..0000000
--- a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
+++ /dev/null
@@ -1,1194 +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.
- */
-
-#define ROOT_NAME "testThinClientPoolExecuteFunctionPrSHOP"
-
-#include "fw_dunit.hpp"
-#include "ThinClientHelper.hpp"
-#include "testobject/VariousPdxTypes.hpp"
-#include <geode/PdxInstanceFactory.hpp>
-#include <geode/UserFunctionExecutionException.hpp>
-#include <geode/FunctionService.hpp>
-#include <geode/DefaultResultCollector.hpp>
-
-#include "SerializationRegistry.hpp"
-#include "CacheRegionHelper.hpp"
-#include "CacheImpl.hpp"
-
-
-using namespace PdxTests;
-
-/* This is to test
-1- funtion execution on pool
-*/
-
-#define CLIENT1 s1p1
-#define LOCATOR1 s2p1
-#define SERVER s2p2
-
-bool isLocalServer = false;
-bool isLocator = false;
-bool isPoolWithEndpoint = false;
-
-const char* locHostPort =
- CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-const char* poolRegNames[] = {"partition_region", "PoolRegion2"};
-
-const char* serverGroup = "ServerGroup1";
-
-char* getFuncIName = (char*)"MultiGetFunctionI";
-char* putFuncIName = (char*)"MultiPutFunctionI";
-char* getFuncName = (char*)"MultiGetFunction";
-char* putFuncName = (char*)"MultiPutFunction";
-char* rjFuncName = (char*)"RegionOperationsFunction";
-char* exFuncName = (char*)"ExceptionHandlingFunction";
-char* exFuncNameSendException = (char*)"executeFunction_SendException";
-char* exFuncNamePdxType = (char*)"PdxFunctionTest";
-char* FEOnRegionPrSHOP = (char*)"FEOnRegionPrSHOP";
-char* FEOnRegionPrSHOP_OptimizeForWrite =
- (char*)"FEOnRegionPrSHOP_OptimizeForWrite";
-char* FETimeOut = (char*)"FunctionExecutionTimeOut";
-
-#define verifyGetResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "VALUE--%d", j); \
- if (strcmp(buf, std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()) == 0) { \
- LOGINFO( \
- "buf = %s " \
- "std::dynamic_pointer_cast<CacheableString>(resultList->operator[](" \
- "i))->value().c_str() " \
- "= %s ", \
- buf, \
- std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()); \
- found = true; \
- break; \
- } \
- } \
- ASSERT(found, "this returned value is invalid");
-
-#define verifyGetKeyResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "KEY--%d", j); \
- if (strcmp(buf, std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()) == 0) { \
- LOGINFO( \
- "buf = %s " \
- "std::dynamic_pointer_cast<CacheableString>(resultList->operator[](" \
- "i))->value().c_str() " \
- "= %s ", \
- buf, \
- std::dynamic_pointer_cast<CacheableString>( \
- resultList->operator[](i)) \
- ->value() \
- .c_str()); \
- found = true; \
- break; \
- } \
- } \
- ASSERT(found, "this returned KEY is invalid");
-
-#define verifyPutResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "KEY--%d", j); \
- if (strcmp(buf, value->value().c_str()) == 0) { \
- found = true; \
- break; \
- } \
- } \
- ASSERT(found, "this returned value is invalid");
-
-class MyResultCollector : public DefaultResultCollector {
- public:
- MyResultCollector()
- : m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
- ~MyResultCollector() noexcept {}
-
- std::shared_ptr<CacheableVector> getResult(
- std::chrono::milliseconds timeout) override {
- m_getResultCount++;
- return DefaultResultCollector::getResult(timeout);
- }
-
- void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
- m_addResultCount++;
- if (resultItem == nullptr) {
- return;
- }
- if (auto results =
- std::dynamic_pointer_cast<CacheableArrayList>(resultItem)) {
- for (auto& result : *results) {
- DefaultResultCollector::addResult(result);
- }
- } else {
- DefaultResultCollector::addResult(resultItem);
- }
- }
-
- void endResults() override {
- m_endResultCount++;
- DefaultResultCollector::endResults();
- }
-
- uint32_t getEndResultCount() { return m_endResultCount; }
- uint32_t getAddResultCount() { return m_addResultCount; }
- uint32_t getGetResultCount() { return m_getResultCount; }
-
- private:
- uint32_t m_endResultCount;
- uint32_t m_addResultCount;
- uint32_t m_getResultCount;
-};
-
-template <class _T>
-bool validateResultTypeAndAllowUserFunctionExecutionException(
- const int32_t index, const std::shared_ptr<Cacheable>& result) {
- if (auto intValue = std::dynamic_pointer_cast<_T>(result)) {
- LOGINFO("%s is %d ", typeid(_T).name(), intValue->value());
- return true;
- } else {
- if (auto uFEPtr =
- std::dynamic_pointer_cast<UserFunctionExecutionException>(result)) {
- LOGINFO("Done casting to uFEPtr");
- LOGINFO("Read expected uFEPtr exception %s ",
- uFEPtr->getMessage().c_str());
- return true;
- } else {
- LOGINFO("Unexpected result type %s for index %d.",
- result->toString().c_str(), index);
- }
- }
-
- return false;
-}
-
-bool validateResultTypeIsUserFunctionExecutionException(
- const int32_t index, const std::shared_ptr<Cacheable>& result) {
- if (auto uFEPtr =
- std::dynamic_pointer_cast<UserFunctionExecutionException>(result)) {
- LOGINFO("Done casting to uFEPtr");
- LOGINFO("Read expected uFEPtr exception %s ", uFEPtr->getMessage().c_str());
- return true;
- } else {
- LOGINFO("Unexpected result type %s for index %d.",
- result->toString().c_str(), index);
- }
-
- return false;
-}
-
-template <class _T>
-bool validateResultType(const int32_t index, const std::shared_ptr<Cacheable>& result) {
- return false;
-}
-
-DUNIT_TASK_DEFINITION(LOCATOR1, StartLocator1)
- {
- // starting locator
- if (isLocator) {
- CacheHelper::initLocator(1);
- LOG("Locator1 started");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER, StartS12)
- {
- const char* lhp = nullptr;
- if (!isPoolWithEndpoint) lhp = locHostPort;
- if (isLocalServer) {
- CacheHelper::initServer(1, "func_cacheserver1_pool.xml", lhp);
- }
- if (isLocalServer) {
- CacheHelper::initServer(2, "func_cacheserver2_pool.xml", lhp);
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
- {
- initClientWithPool(true, poolRegNames[0], locHostPort, serverGroup, nullptr,
- 0, true, -1, -1, 60000, /*singlehop*/ true,
- /*threadLocal*/ true);
-
- auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
- regPtr0->registerAllKeys();
-
- LOG("Clnt1Init complete.");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
- {
- auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- char buf[128];
-
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
-
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableString::create(buf);
- regPtr0->put(key, value);
- }
- SLEEP(10000); // let the put finish
- try {
- std::shared_ptr<Cacheable> args = CacheableBoolean::create(1);
- auto routingObj = CacheableVector::create();
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- routingObj->push_back(key);
- }
-
- // test data dependant function
- // test get function with result
- auto exc = FunctionService::onRegion(regPtr0);
- ASSERT(exc != nullptr, "onRegion Returned nullptr");
- args = CacheableKey::create("echoString");
- std::shared_ptr<Cacheable> args1 = CacheableKey::create("echoBoolean");
- auto exe1 = exc->withArgs(args);
- auto exe2 = exe1->withArgs(args1);
-
- auto resultList = CacheableVector::create();
- auto executeFunctionResult =
- exe1->execute(rjFuncName, std::chrono::seconds(15))->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "echo String : executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo String : result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- if (auto csp = std::dynamic_pointer_cast<CacheableString>(
- executeFunctionResult->operator[](0))) {
- sprintf(buf, "echo String : cast successful, echoed string= %s",
- csp->value().c_str());
- LOG(buf);
- } else {
- FAIL("echo String : wrong argument type");
- }
- }
- executeFunctionResult =
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(exFuncName, std::chrono::seconds(15))
- ->getResult();
-
- executeFunctionResult =
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(rjFuncName, std::chrono::seconds(15))
- ->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "echo String : executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo String : result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- const char* str = std::dynamic_pointer_cast<CacheableString>(
- executeFunctionResult->operator[](0))
- ->value()
- .c_str();
- LOG(str);
- ASSERT(strcmp("echoString", str) == 0, "echoString is not eched back");
- }
- args = CacheableKey::create("echoBoolean");
- executeFunctionResult =
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(rjFuncName, std::chrono::seconds(15))
- ->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "echo Boolean: executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo Boolean: result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult->operator[](0))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
-
- executeFunctionResult = exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(getFuncName)
- ->getResult();
- /****
- **decomposed from above long expression:
- exc = exc->withFilter(routingObj);
- ASSERT(exc!=nullptr, "withFilter Returned nullptr");
- exc = exc->withArgs(args);
- ASSERT(exc!=nullptr, "withArgs Returned nullptr");
- auto rc = exc->execute(getFuncName);
- ASSERT(rc!=nullptr, "execute Returned nullptr");
- auto executeFunctionResult = rc->getResult();
- */
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "region get: executeFunctionResult is nullptr");
- } else {
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "Region get: result count = %zd", resultList->size());
- LOG(buf);
- ASSERT(resultList->size() == 34,
- "region get: resultList count is not 34");
- for (int32_t i = 0; i < resultList->size(); i++) {
- auto csPtr = std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i));
- // printf(" in csPtr = %u \n",csPtr);
- if (csPtr != nullptr) {
- sprintf(buf, "Region get: result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- } else {
- std::shared_ptr<Cacheable> tmp = resultList->operator[](i);
- if (tmp != nullptr) {
- printf(" in typeid = %d \n", tmp->typeId());
-
- } else {
- printf(" in typeid is null \n");
- }
- }
- }
- }
- // test get function with customer collector
- auto myRC = std::make_shared<MyResultCollector>();
- executeFunctionResult = exc->withFilter(routingObj)
- ->withArgs(args)
- ->withCollector(myRC)
- ->execute(getFuncName)
- ->getResult();
- sprintf(buf, "add result count = %d", myRC->getAddResultCount());
- LOG(buf);
- sprintf(buf, "end result count = %d", myRC->getEndResultCount());
- LOG(buf);
- sprintf(buf, "get result count = %d", myRC->getGetResultCount());
- LOG(buf);
- if (executeFunctionResult == nullptr) {
- ASSERT(false,
- "region get new collector: executeFunctionResult is nullptr");
- } else {
- resultList->clear();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- resultList->push_back(executeFunctionResult->operator[](item));
- }
- sprintf(buf, "Region get new collector: result list count = %zd",
- resultList->size());
- LOG(buf);
- sprintf(buf, "Region get new collector: result count = %zd",
- executeFunctionResult->size());
- LOG(buf);
- ASSERT(
- executeFunctionResult->size() == resultList->size(),
- "region get new collector: executeFunctionResult count is not 34");
- for (int32_t i = 0; i < executeFunctionResult->size(); i++) {
- sprintf(buf, "Region get new collector: result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- }
- }
- // test put function without result
- exc->withFilter(routingObj)
- ->withArgs(args)
- ->execute(putFuncName, std::chrono::seconds(15));
- SLEEP(10000); // let the put finish
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- auto value =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
- sprintf(buf, "Region put: result[%d]=%s", i, value->value().c_str());
- LOG(buf);
- verifyPutResults()
- }
-
- args = routingObj;
- executeFunctionResult =
- exc->withArgs(args)
- ->withFilter(routingObj)
- ->execute(getFuncName, std::chrono::seconds(15))
- ->getResult();
-
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "get executeFunctionResult is nullptr");
- } else {
- sprintf(buf, "echo String : result count = %zd",
- executeFunctionResult->size());
- LOGINFO(buf);
- resultList->clear();
-
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOGINFO(buf);
- ASSERT(resultList->size() == 34,
- "get executeFunctionResult count is not 34");
- for (int32_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- sprintf(buf, "get result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOGINFO(buf);
- verifyGetKeyResults()
- }
- }
-
- //-----------------------Test with sendException
- // onRegion-------------------------------//
- for (int i = 1; i <= 200; i++) {
- auto value = CacheableInt32::create(i);
-
- sprintf(buf, "execKey-%d", i);
- auto key = CacheableKey::create(buf);
- regPtr0->put(key, value);
- }
- LOG("Put for execKey's on region complete.");
-
- LOG("Adding filter");
- auto arrList = CacheableArrayList::create();
- for (int i = 100; i < 120; i++) {
- sprintf(buf, "execKey-%d", i);
- auto key = CacheableKey::create(buf);
- arrList->push_back(key);
- }
-
- auto filter = CacheableVector::create();
- for (int i = 100; i < 120; i++) {
- sprintf(buf, "execKey-%d", i);
- auto key = CacheableKey::create(buf);
- filter->push_back(key);
- }
- LOG("Adding filter done.");
-
- args = CacheableBoolean::create(1);
-
- auto funcExec = FunctionService::onRegion(regPtr0);
- ASSERT(funcExec != nullptr, "onRegion Returned nullptr");
-
- auto collector = funcExec->withArgs(args)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onRegion collector nullptr");
-
- auto result = collector->getResult();
-
- if (result == nullptr) {
- ASSERT(false, "echo String : result is nullptr");
- } else {
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for bool "
- "arguement exception.");
- }
- }
- LOG("exFuncNameSendException done for bool arguement.");
-
- collector = funcExec->withArgs(arrList)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onRegion collector for arrList nullptr");
-
- result = collector->getResult();
- LOGINFO("result->size() = %d & arrList->size() = %d ", result->size(),
- arrList->size() + 1);
- ASSERT(
- result->size() == arrList->size() + 1,
- "region get: resultList count is not as arrayList count + exception");
-
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeAndAllowUserFunctionExecutionException<
- CacheableInt32>(i, result->operator[](i)),
- "Unexpected result type.");
- }
-
- LOG("exFuncNameSendException done for arrayList arguement.");
-
- LOG("exFuncNameSendException for string arguement.");
-
- args = CacheableString::create("Multiple");
- collector = funcExec->withArgs(args)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onRegion collector for string nullptr");
- result = collector->getResult();
- LOGINFO("result->size() for Multiple String = %d ", result->size());
- ASSERT(result->size() == 1,
- "region get: resultList count is not as string exception");
-
- for (int i = 0; i < result->size(); i++) {
- LOG("exFuncNameSendException now casting to "
- "UserFunctionExecutionExceptionPtr for arrayList arguement "
- "exception.");
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for string "
- "arguement exception.");
- }
-
- LOG("exFuncNameSendException for string arguement done.");
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement using onRegion.");
-
- auto myRC1 = std::make_shared<MyResultCollector>();
- result = funcExec->withArgs(args)
- ->withFilter(filter)
- ->withCollector(myRC1)
- ->execute(exFuncNameSendException)
- ->getResult();
- LOGINFO("add result count = %d", myRC1->getAddResultCount());
- LOGINFO("end result count = %d", myRC1->getEndResultCount());
- LOGINFO("get result count = %d", myRC1->getGetResultCount());
- ASSERT(1 == myRC1->getAddResultCount(), "add result count is not 1");
- ASSERT(1 == myRC1->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == myRC1->getGetResultCount(), "get result count is not 1");
- if (result == nullptr) {
- ASSERT(false, "region get new collector: result is nullptr");
- } else {
- LOGINFO("Region get new collector: result count = %d", result->size());
- ASSERT(1 == result->size(),
- "region get new collector: result count is not 1");
- }
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement done using onRegion.");
-
- //-----------------------Test with sendException onRegion
- // done-------------------------------//
-
- // restore the data set
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
-
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableString::create(buf);
- regPtr0->put(key, value);
- }
-
- // test data independant function
- // test get function with result
- args = routingObj;
-
- // test data independant function on one server
- LOG("test data independant get function on one server");
- exc = FunctionService::onServer(getHelper()->cachePtr);
- executeFunctionResult =
- exc->withArgs(args)->execute(getFuncIName)->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "get executeFunctionResult is nullptr");
- } else {
- resultList->clear();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOG(buf);
- ASSERT(resultList->size() == 17,
- "get executeFunctionResult count is not 17");
- for (int32_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- sprintf(buf, "get result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- }
- }
- LOG("test data independant put function on one server");
- // test put function without result
- exc->withArgs(args)->execute(putFuncIName, std::chrono::seconds(15));
- SLEEP(500); // let the put finish
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- auto value =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
- sprintf(buf, "put: result[%d]=%s", i, value->value().c_str());
- LOG(buf);
- verifyPutResults()
- }
- LOG("test data independant get function on all servers");
- // test data independant function on all servers
- // test get
-
- //-----------------------Test with PdxObject
- // onServers-------------------------------//
-
- try {
- auto serializationRegistry =
- CacheRegionHelper::getCacheImpl(getHelper()->getCache().get())
- ->getSerializationRegistry();
-
- serializationRegistry->addPdxType(
- PdxTests::PdxTypes8::createDeserializable);
- } catch (const IllegalStateException&) {
- // ignore exception
- }
-
- auto pdxobj = std::make_shared<PdxTests::PdxTypes8>();
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- regPtr0->put(key, pdxobj);
- }
- LOGINFO("put on pdxObject done");
-
- auto pdxRoutingObj = CacheableVector::create();
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- pdxRoutingObj->push_back(key);
- }
-
- auto pdxExc = FunctionService::onServers(getHelper()->cachePtr);
- auto executeFunctionResultPdx = pdxExc->withArgs(pdxRoutingObj)
- ->execute(exFuncNamePdxType)
- ->getResult();
- LOGINFO("FE on pdxObject done");
- if (executeFunctionResultPdx == nullptr) {
- ASSERT(false, "get executeFunctionResultPdx is nullptr");
- } else {
- LOGINFO("executeFunctionResultPdx size for PdxObject = %d ",
- executeFunctionResultPdx->size());
- ASSERT(2 == executeFunctionResultPdx->size(),
- "executeFunctionResultPdx->size() is not 2");
- auto resultListPdx = CacheableVector::create();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResultPdx->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResultPdx->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultListPdx->push_back(arrayList->operator[](pos));
- }
- }
- LOGINFO("resultlistPdx size: %d", resultListPdx->size());
- for (int32_t i = 0; i < resultListPdx->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultListPdx->operator[](i) != nullptr, buf);
- LOG("resultPdx item is not null");
- LOGINFO(
- "get result[%d]=%s", i,
- std::dynamic_pointer_cast<PdxTypes8>(resultListPdx->operator[](i))
- ->toString()
- .c_str());
- auto pdxObj2 = std::dynamic_pointer_cast<PdxTypes8>(
- resultListPdx->operator[](i));
- ASSERT(pdxobj->equals(pdxObj2) == true,
- "Pdx Object not equals original object.");
- }
- }
- LOG("test pdx data function on all servers done");
-
- auto pifPtr = cacheHelper->getCache()->createPdxInstanceFactory(
- "PdxTests.PdxTypes8");
- LOG("PdxInstanceFactoryPtr created....");
-
- pifPtr->writeInt("i1", 1);
- pifPtr->writeInt("i2", 2);
- pifPtr->writeString("s1", "m_s1");
- pifPtr->writeString("s2", "m_s2");
- pifPtr->writeInt("i3", 3);
- pifPtr->writeInt("i4", 4);
-
- auto ret = pifPtr->create();
- LOG("PdxInstancePtr created");
-
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- regPtr0->put(key, pdxobj);
- }
- LOGINFO("put on pdxObject done");
-
- auto pdxInstanceRoutingObj = CacheableVector::create();
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--pdx%d", i);
- auto key = CacheableKey::create(buf);
- pdxInstanceRoutingObj->push_back(key);
- }
-
- auto pdxInstanceExc = FunctionService::onServers(getHelper()->cachePtr);
- auto executeFunctionResultPdxInstance =
- pdxInstanceExc->withArgs(pdxInstanceRoutingObj)
- ->execute(exFuncNamePdxType)
- ->getResult();
- LOGINFO("FE on pdxObject done");
- if (executeFunctionResultPdxInstance == nullptr) {
- ASSERT(false, "get executeFunctionResultPdxInstance is nullptr");
- } else {
- LOGINFO("executeFunctionResultPdxInstance size for PdxObject = %d ",
- executeFunctionResultPdxInstance->size());
- ASSERT(2 == executeFunctionResultPdx->size(),
- "executeFunctionResultPdxInstance->size() is not 2");
- auto resultListPdxInstance = CacheableVector::create();
- for (unsigned item = 0;
- item <
- static_cast<uint32_t>(executeFunctionResultPdxInstance->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResultPdxInstance->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultListPdxInstance->push_back(arrayList->operator[](pos));
- }
- }
- LOGINFO("resultlistPdxInstance size: %d",
- resultListPdxInstance->size());
- for (int32_t i = 0; i < resultListPdxInstance->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultListPdxInstance->operator[](i) != nullptr, buf);
- LOG("resultPdx item is not null");
- LOGINFO("get result[%d]=%s", i,
- std::dynamic_pointer_cast<PdxTypes8>(
- resultListPdxInstance->operator[](i))
- ->toString()
- .c_str());
- auto pdxObj2 = std::dynamic_pointer_cast<PdxTypes8>(
- resultListPdxInstance->operator[](i));
-
- ASSERT(pdxobj->equals(pdxObj2) == true,
- "Pdx Object not equals original object.");
- }
- }
- LOG("test pdx data function on all servers done");
-
- //-----------------------Test with PdxObject onServers
- // done.-------------------------------//
-
- // repopulate with the original values
- for (int i = 0; i < 34; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
-
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableString::create(buf);
- regPtr0->put(key, value);
- }
- SLEEP(10000); // let the put finish
- //---------------------------------------------------------------------
- // adding one more server, this should be return by locator and then
- // function should be executed on all the 3 servers
-
- const char* lhp = nullptr;
- if (!isPoolWithEndpoint) lhp = locHostPort;
-
- if (isLocalServer) {
- CacheHelper::initServer(3, "func_cacheserver3_pool.xml", lhp);
- }
- LOGINFO("Sleeping for 60s...");
- SLEEP(60000); // let this servers gets all the data
-
- //---------------------------------------------------------------------
- exc = FunctionService::onServers(getHelper()->cachePtr);
- executeFunctionResult =
- exc->withArgs(args)->execute(getFuncIName)->getResult();
- if (executeFunctionResult == nullptr) {
- ASSERT(false, "get executeFunctionResult is nullptr");
- } else {
- resultList->clear();
- for (unsigned item = 0;
- item < static_cast<uint32_t>(executeFunctionResult->size());
- item++) {
- auto arrayList = std::dynamic_pointer_cast<CacheableArrayList>(
- executeFunctionResult->operator[](item));
- for (unsigned pos = 0; pos < static_cast<uint32_t>(arrayList->size());
- pos++) {
- resultList->push_back(arrayList->operator[](pos));
- }
- }
- sprintf(buf, "get result count = %zd", resultList->size());
- LOG(buf);
- printf("resultlist size: %zd", resultList->size());
- ASSERT(resultList->size() == 51,
- "get executeFunctionResult on all servers count is not 51");
- for (int32_t i = 0; i < resultList->size(); i++) {
- sprintf(buf, "result[%d] is null\n", i);
- ASSERT(resultList->operator[](i) != nullptr, buf);
- sprintf(buf, "get result[%d]=%s", i,
- std::dynamic_pointer_cast<CacheableString>(
- resultList->operator[](i))
- ->value()
- .c_str());
- LOG(buf);
- verifyGetResults()
- }
- }
- LOG("test data independant put function on all servers");
- // test data independant function on all servers
- // test put
- exc->withArgs(args)->execute(putFuncIName, std::chrono::seconds(15));
- SLEEP(10000); // let the put finish
- for (int i = 0; i < 34; i++) {
- if (i % 2 == 0) continue;
- sprintf(buf, "KEY--%d", i);
- auto key = CacheableKey::create(buf);
- auto value =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
- sprintf(buf, "put: result[%d]=%s", i, value->value().c_str());
- LOG(buf);
- verifyPutResults()
- }
- //-----------------------Test with sendException
- // onServers-------------------------------//
- LOG("OnServers with sendException");
- args = CacheableBoolean::create(1);
- funcExec = FunctionService::onServers(getHelper()->cachePtr);
-
- collector = funcExec->withArgs(args)->execute(exFuncNameSendException,
- std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onServers collector for bool nullptr");
-
- result = collector->getResult();
- ASSERT(result->size() == 3,
- "Should have got 3 exception strings for sendException.");
- if (result == nullptr) {
- ASSERT(false, "echo String : result is nullptr");
- } else {
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for bool arguement "
- "Unknown exception.");
- }
- }
-
- collector = funcExec->withArgs(arrList)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onServers collector for arrList nullptr");
-
- result = collector->getResult();
- ASSERT(result->size() == (arrList->size() + 1) * 3,
- "onServers get: resultList count is not as arrayList count + "
- "exception");
-
- LOG("Printing only string exception results for onServers with "
- "sendException");
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeAndAllowUserFunctionExecutionException<
- CacheableInt32>(i, result->operator[](i)),
- "Unexpected result type.");
- }
-
- LOG("Printing all results for onServers with sendException");
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeAndAllowUserFunctionExecutionException<
- CacheableInt32>(i, result->operator[](i)),
- "Unexpected result type.");
- }
-
- LOG("exFuncNameSendException for string arguement.");
-
- args = CacheableString::create("Multiple");
- collector = funcExec->withArgs(args)->execute(exFuncNameSendException,
- std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onServers collector for string nullptr");
-
- result = collector->getResult();
- ASSERT(result->size() == 3,
- "region get: resultList count is not as string exception");
-
- for (int i = 0; i < result->size(); i++) {
- ASSERT(validateResultTypeIsUserFunctionExecutionException(
- i, result->operator[](i)),
- "exFuncNameSendException casting to string for string arguement "
- "exception.");
- }
-
- LOG("exFuncNameSendException for string arguement done.");
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement using onServers.");
-
- auto myRC2 = std::make_shared<MyResultCollector>();
- result = funcExec->withArgs(args)
- ->withCollector(myRC2)
- ->execute(exFuncNameSendException)
- ->getResult();
- ASSERT(3 == myRC2->getAddResultCount(), "add result count is not 3");
- ASSERT(1 == myRC2->getEndResultCount(), "end result count is not 1");
- ASSERT(1 == myRC2->getGetResultCount(), "get result count is not 1");
- LOGINFO("add result count = %d", myRC2->getAddResultCount());
- LOGINFO("end result count = %d", myRC2->getEndResultCount());
- LOGINFO("get result count = %d", myRC2->getGetResultCount());
- if (result == nullptr) {
- ASSERT(false, "region get new collector: result is nullptr");
- } else {
- LOGINFO("Region get new collector: result count = %d", result->size());
- ASSERT(3 == result->size(),
- "region get new collector: result count is not 1");
- }
-
- LOGINFO(
- "test exFuncNameSendException function with customer collector with "
- "bool as arguement done using onServers.");
-
- LOG("OnServers with sendException done");
-
- //-----------------------Test with sendException onServers
- // done.-------------------------------//
-
- //-----------------------Test with single filter key
- // onRegion-------------------------------//
- for (int i = 0; i < 230; i++) {
- sprintf(buf, "VALUE--%d", i);
- auto value = CacheableString::create(buf);
- regPtr0->put(i, value);
- }
- LOGINFO("Put done.");
-
- for (int i = 0; i < 230; i++) {
- auto fil = CacheableVector::create();
- fil->push_back(CacheableInt32::create(i));
- auto exe = FunctionService::onRegion(regPtr0);
- auto executeFunctionResult2 =
- exe->withFilter(fil)
- ->execute(FEOnRegionPrSHOP, std::chrono::seconds(15))
- ->getResult();
- if (executeFunctionResult2 == nullptr) {
- ASSERT(false, "executeFunctionResult2 is nullptr");
- } else {
- sprintf(buf, "executeFunctionResult2 count = %zd",
- executeFunctionResult2->size());
- LOGINFO(buf);
- ASSERT(1 == executeFunctionResult2->size(),
- "executeFunctionResult2->size() is not 1");
- for (int i = 0; i < executeFunctionResult2->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- executeFunctionResult2->operator[](i))
- ->value();
- LOGINFO(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- executeFunctionResult2->clear();
- LOGINFO("FEOnRegionPrSHOP without Filter done");
-
- auto functionResult = exe->withFilter(fil)
- ->execute(FEOnRegionPrSHOP_OptimizeForWrite,
- std::chrono::seconds(15))
- ->getResult();
- if (functionResult == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", functionResult->size());
- LOGINFO(buf);
- ASSERT(1 == functionResult->size(),
- "functionResult->size() is not 1");
- for (int i = 0; i < functionResult->size(); i++) {
- bool b = std::dynamic_pointer_cast<CacheableBoolean>(
- functionResult->operator[](i))
- ->value();
- LOGINFO(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FEOnRegionPrSHOP_OptimizeForWrite without Filter done");
- }
- //-----------------------Test with single filter key onRegion
- // done-------------------------------//
-
- //////////////////////OnRegion TimeOut ///////////////////////////
- LOGINFO("FETimeOut begin onRegion");
- auto timeout = std::chrono::milliseconds{5000};
- auto RexecutionPtr = FunctionService::onRegion(regPtr0);
- auto fe = RexecutionPtr->withArgs(CacheableInt32::create(timeout.count()))
- ->execute(FETimeOut, timeout)
- ->getResult();
- if (fe == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", fe->size());
- LOG(buf);
- // ASSERT(2 == fe->size(), "FunctionResult->size() is not 2");
- for (int i = 0; i < fe->size(); i++) {
- bool b =
- std::dynamic_pointer_cast<CacheableBoolean>(fe->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FETimeOut done onRegion");
- //////////////////////OnRegion TimeOut Done///////////////////////////
-
- LOGINFO("FETimeOut begin onServer");
- auto serverExc = FunctionService::onServer(getHelper()->cachePtr);
- auto vec = serverExc->withArgs(CacheableInt32::create(timeout.count()))
- ->execute(FETimeOut, timeout)
- ->getResult();
- if (vec == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", vec->size());
- LOG(buf);
- ASSERT(1 == vec->size(), "FunctionResult->size() is not 1");
- for (int i = 0; i < vec->size(); i++) {
- bool b =
- std::dynamic_pointer_cast<CacheableBoolean>(vec->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FETimeOut done onServer");
-
- LOGINFO("FETimeOut begin onServers");
- auto serversExc = FunctionService::onServers(getHelper()->cachePtr);
- auto vecs = serversExc->withArgs(CacheableInt32::create(timeout.count()))
- ->execute(FETimeOut, timeout)
- ->getResult();
- if (vecs == nullptr) {
- ASSERT(false, "functionResult is nullptr");
- } else {
- sprintf(buf, "result count = %zd", vecs->size());
- LOG(buf);
- ASSERT(3 == vecs->size(), "FunctionResult->size() is not 3");
- for (int i = 0; i < vecs->size(); i++) {
- bool b =
- std::dynamic_pointer_cast<CacheableBoolean>(vecs->operator[](i))
- ->value();
- LOG(b == true ? "true" : "false");
- ASSERT(b == true, "true is not eched back");
- }
- }
- LOGINFO("FETimeOut done onServers");
-
- } catch (const Exception& excp) {
- std::string logmsg = "";
- logmsg += excp.getName();
- logmsg += ": ";
- logmsg += excp.what();
- LOG(logmsg.c_str());
- LOG(excp.getStackTrace());
- FAIL("Function Execution Failed!");
- }
- isPoolWithEndpoint = true;
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, StopC1)
- {
- cleanProc();
- LOG("Clnt1Down complete: Keepalive = True");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER, CloseServers)
- {
- // stop servers
- if (isLocalServer) {
- CacheHelper::closeServer(1);
- LOG("SERVER1 stopped");
- }
- if (isLocalServer) {
- CacheHelper::closeServer(2);
- LOG("SERVER2 stopped");
- }
- if (isLocalServer) {
- CacheHelper::closeServer(3);
- LOG("SERVER3 stopped");
- }
- isPoolWithEndpoint = true;
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(LOCATOR1, CloseLocator1)
- {
- // stop locator
- if (isLocator) {
- CacheHelper::closeLocator(1);
- LOG("Locator1 stopped");
- }
- }
-END_TASK_DEFINITION
-
-void runFunctionExecution() {
- CALL_TASK(StartLocator1);
- CALL_TASK(StartS12);
- CALL_TASK(StartC1);
- CALL_TASK(Client1OpTest);
- CALL_TASK(StopC1);
- CALL_TASK(CloseServers);
- CALL_TASK(CloseLocator1);
-}
-
-DUNIT_MAIN
- { runFunctionExecution(); }
-END_MAIN
diff --git a/tests/javaobject/FunctionExecutionTimeOut.java b/tests/javaobject/FunctionExecutionTimeOut.java
deleted file mode 100644
index c5b8c8f..0000000
--- a/tests/javaobject/FunctionExecutionTimeOut.java
+++ /dev/null
@@ -1,81 +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.
- */
-package javaobject;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Vector;
-import java.util.HashSet;
-import org.apache.geode.cache.Declarable;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.EntryNotFoundException;
-import org.apache.geode.cache.execute.FunctionAdapter;
-import org.apache.geode.cache.execute.FunctionContext;
-import org.apache.geode.cache.execute.RegionFunctionContext;
-import org.apache.geode.cache.partition.PartitionRegionHelper;
-import org.apache.geode.internal.cache.PartitionedRegion;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.cache.CacheServerImpl;
-
-import org.apache.geode.internal.cache.tier.ServerSideHandshake;
-import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
-import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
-import org.apache.geode.LogWriter;
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-
-public class FunctionExecutionTimeOut extends FunctionAdapter implements
- Declarable {
-
- public void execute(FunctionContext context) {
- DistributedSystem ds = InternalDistributedSystem.getAnyInstance();
- LogWriter logger = ds.getLogWriter();
- logger.info("Executing FunctionExecutionTimeOut ");
- int expected = (Integer)context.getArguments();
- boolean timeoutFound = false;
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
- AcceptorImpl acceptor = ((CacheServerImpl) cache.getCacheServers().get(0)).getAcceptor();
- ServerConnection[] scs = acceptor.getAllServerConnectionList();
- for (int i = 0; i < scs.length; ++i) {
- ServerSideHandshake handshake = scs[i].getHandshake();
- if (handshake != null) {
- logger.info("handshake.getClientReadTimeout() = " + handshake.getClientReadTimeout());
- }
- if (handshake != null && expected == handshake.getClientReadTimeout()) {
- // success
- timeoutFound = true;
- break;
- }
- }
- context.getResultSender().lastResult(timeoutFound);
- }
-
- public boolean isHA() {
- return false;
- }
-
- public String getId() {
- return "FunctionExecutionTimeOut";
- }
-
- public void init(Properties props) {
- }
-
-}
--
To stop receiving notification emails like this one, please contact
echobravo@apache.org.
[geode-native] 01/05: GEODE-4697: Rename ClientHandShake to
ServerSideHandshake
Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
echobravo pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
commit 8c8f4d97d1e7dafc2e94a78bce2df68427bc647a
Author: Michael Oleske <mo...@pivotal.io>
AuthorDate: Fri Feb 16 14:23:21 2018 -0800
GEODE-4697: Rename ClientHandShake to ServerSideHandshake
- remove unused FunctionExcuteTimeOut
Signed-off-by: Ryan McMahon <rm...@pivotal.io>
---
.../testThinClientPoolExecuteFunctionThrowsException.cpp | 1 -
tests/javaobject/FunctionExecutionTimeOut.java | 10 +++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp
index 3ac044c..2e43bc5 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp
@@ -57,7 +57,6 @@ char* exFuncNamePdxType = (char*)"PdxFunctionTest";
char* FEOnRegionPrSHOP = (char*)"FEOnRegionPrSHOP";
char* FEOnRegionPrSHOP_OptimizeForWrite =
(char*)"FEOnRegionPrSHOP_OptimizeForWrite";
-char* FETimeOut = (char*)"FunctionExecutionTimeOut";
#define verifyGetResults() \
bool found = false; \
diff --git a/tests/javaobject/FunctionExecutionTimeOut.java b/tests/javaobject/FunctionExecutionTimeOut.java
index a2b6fd4..c5b8c8f 100644
--- a/tests/javaobject/FunctionExecutionTimeOut.java
+++ b/tests/javaobject/FunctionExecutionTimeOut.java
@@ -34,7 +34,7 @@ import org.apache.geode.internal.cache.PartitionedRegion;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.tier.ClientHandShake;
+import org.apache.geode.internal.cache.tier.ServerSideHandshake;
import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
import org.apache.geode.LogWriter;
@@ -54,11 +54,11 @@ public class FunctionExecutionTimeOut extends FunctionAdapter implements
AcceptorImpl acceptor = ((CacheServerImpl) cache.getCacheServers().get(0)).getAcceptor();
ServerConnection[] scs = acceptor.getAllServerConnectionList();
for (int i = 0; i < scs.length; ++i) {
- ClientHandShake hs = scs[i].getHandshake();
- if (hs != null) {
- logger.info("hs.getClientReadTimeout() = " + hs.getClientReadTimeout());
+ ServerSideHandshake handshake = scs[i].getHandshake();
+ if (handshake != null) {
+ logger.info("handshake.getClientReadTimeout() = " + handshake.getClientReadTimeout());
}
- if (hs != null && expected == hs.getClientReadTimeout()) {
+ if (handshake != null && expected == handshake.getClientReadTimeout()) {
// success
timeoutFound = true;
break;
--
To stop receiving notification emails like this one, please contact
echobravo@apache.org.
[geode-native] 03/05: GEODE-4697: Removing FunctionExecutionTimeout
from server configs
Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
echobravo pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
commit 8b383029f898e78e0e1301a4463648d67f7268c1
Author: Ryan McMahon <rm...@pivotal.io>
AuthorDate: Tue Feb 20 13:28:22 2018 -0800
GEODE-4697: Removing FunctionExecutionTimeout from server configs
Signed-off-by: Michael Oleske <mo...@pivotal.io>
---
.../integration-test/func_cacheserver1_pool.xml | 138 ++++++++++-----------
.../integration-test/func_cacheserver2_pool.xml | 135 ++++++++++----------
.../integration-test/func_cacheserver3_pool.xml | 120 +++++++++---------
3 files changed, 184 insertions(+), 209 deletions(-)
diff --git a/clicache/integration-test/func_cacheserver1_pool.xml b/clicache/integration-test/func_cacheserver1_pool.xml
index 039750d..820faa5 100644
--- a/clicache/integration-test/func_cacheserver1_pool.xml
+++ b/clicache/integration-test/func_cacheserver1_pool.xml
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,79 +15,72 @@
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
+ 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 host="cod" port="24680" /-->
- <cache-server port="HOST_PORT1">
- <group>ServerGroup1</group>
+ <cache-server port="HOST_PORT1">
+ <group>ServerGroup1</group>
</cache-server>
- <pdx read-serialized="true" />
- <region name='partition_region'>
- <region-attributes data-policy="partition" >
- <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
+ <pdx read-serialized="true" />
+ <region name='partition_region'>
+ <region-attributes data-policy="partition">
+ <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
</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.MultiGetFunction2</class-name>
- </function>
- <function>
- <class-name>javaobject.MultiPutFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.ExceptionHandlingFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAExceptionFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAShutdownFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.PdxFunctionTest</class-name>
- </function>
- <function>
- <class-name>javaobject.SingleStrGetFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.executeFunction_SendException</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FunctionExecutionTimeOut</class-name>
- </function>
- </function-service>
- <serialization-registration>
- <instantiator id="5200" >
- <class-name>javaobject.InstantiatorTest</class-name>
- </instantiator>
- </serialization-registration>
-</cache>
+ <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.MultiGetFunction2</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.MultiPutFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ExceptionHandlingFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAExceptionFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAShutdownFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.PdxFunctionTest</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.SingleStrGetFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.executeFunction_SendException</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
+ </function>
+ </function-service>
+ <serialization-registration>
+ <instantiator id="5200">
+ <class-name>javaobject.InstantiatorTest</class-name>
+ </instantiator>
+ </serialization-registration>
+</cache>
\ No newline at end of file
diff --git a/clicache/integration-test/func_cacheserver2_pool.xml b/clicache/integration-test/func_cacheserver2_pool.xml
index ec90576..354b1ff 100644
--- a/clicache/integration-test/func_cacheserver2_pool.xml
+++ b/clicache/integration-test/func_cacheserver2_pool.xml
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,79 +15,71 @@
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
+ 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="HOST_PORT2">
- <group>ServerGroup1</group>
+ <group>ServerGroup1</group>
</cache-server>
- <pdx read-serialized="true" />
+ <pdx read-serialized="true" />
<region name='partition_region'>
- <region-attributes data-policy="partition" >
- <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
+ <region-attributes data-policy="partition">
+ <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
</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.MultiGetFunction2</class-name>
- </function>
- <function>
- <class-name>javaobject.MultiPutFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.ExceptionHandlingFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAExceptionFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAShutdownFunction</class-name>
- </function>
-
- <function>
- <class-name>javaobject.SingleStrGetFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.executeFunction_SendException</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.PdxFunctionTest</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
- </function>
- <function>
- <class-name>javaobject.FunctionExecutionTimeOut</class-name>
- </function>
- </function-service>
- <serialization-registration>
- <instantiator id="5200" >
- <class-name>javaobject.InstantiatorTest</class-name>
- </instantiator>
- </serialization-registration>
-</cache>
+ <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.MultiGetFunction2</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.MultiPutFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ExceptionHandlingFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAExceptionFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAShutdownFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.SingleStrGetFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.executeFunction_SendException</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.PdxFunctionTest</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
+ </function>
+ </function-service>
+ <serialization-registration>
+ <instantiator id="5200">
+ <class-name>javaobject.InstantiatorTest</class-name>
+ </instantiator>
+ </serialization-registration>
+</cache>
\ No newline at end of file
diff --git a/clicache/integration-test/func_cacheserver3_pool.xml b/clicache/integration-test/func_cacheserver3_pool.xml
index 263dcc0..22a7e51 100644
--- a/clicache/integration-test/func_cacheserver3_pool.xml
+++ b/clicache/integration-test/func_cacheserver3_pool.xml
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,71 +15,64 @@
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
+ 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="HOST_PORT3">
- <group>ServerGroup1</group>
+ <group>ServerGroup1</group>
</cache-server>
<region name='partition_region'>
- <region-attributes data-policy="partition" >
- <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
+ <region-attributes data-policy="partition">
+ <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
</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.RegionOperationsHAFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.ExceptionHandlingFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAExceptionFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAShutdownFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.SingleStrGetFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.executeFunction_SendException</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FunctionExecutionTimeOut</class-name>
- </function>
- </function-service>
- <serialization-registration>
- <instantiator id="5200" >
- <class-name>javaobject.InstantiatorTest</class-name>
- </instantiator>
- </serialization-registration>
-</cache>
+ <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.RegionOperationsHAFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ExceptionHandlingFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAExceptionFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAShutdownFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.SingleStrGetFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.executeFunction_SendException</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
+ </function>
+ </function-service>
+ <serialization-registration>
+ <instantiator id="5200">
+ <class-name>javaobject.InstantiatorTest</class-name>
+ </instantiator>
+ </serialization-registration>
+</cache>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
echobravo@apache.org.
[geode-native] 04/05: GEODE-4697: Removing FunctionExecutionTimeout
from cppcache in addition to clicache
Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
echobravo pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
commit 70eed16a9abccf78aa5d991be932ee6e34f232c0
Author: Michael Oleske <mo...@pivotal.io>
AuthorDate: Tue Feb 20 14:38:10 2018 -0800
GEODE-4697: Removing FunctionExecutionTimeout from cppcache in addition
to clicache
---
.../resources/func_cacheserver1_pool.xml | 144 ++++++++++-----------
.../resources/func_cacheserver2_pool.xml | 143 ++++++++++----------
.../resources/func_cacheserver3_pool.xml | 128 +++++++++---------
3 files changed, 195 insertions(+), 220 deletions(-)
diff --git a/cppcache/integration-test/resources/func_cacheserver1_pool.xml b/cppcache/integration-test/resources/func_cacheserver1_pool.xml
index 98d8b4a..34d6e0e 100755
--- a/cppcache/integration-test/resources/func_cacheserver1_pool.xml
+++ b/cppcache/integration-test/resources/func_cacheserver1_pool.xml
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,81 +15,74 @@
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="HOST_PORT1">
- <group>ServerGroup1</group>
+<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="HOST_PORT1">
+ <group>ServerGroup1</group>
</cache-server>
- <pdx read-serialized="true" />
- <region name='partition_region'>
- <region-attributes data-policy="partition" >
- <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
+ <pdx read-serialized="true" />
+ <region name='partition_region'>
+ <region-attributes data-policy="partition">
+ <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
</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.MultiGetFunction2</class-name>
- </function>
- <function>
- <class-name>javaobject.ThinClientRegionExceptionTest</class-name>
- </function>
- <function>
- <class-name>javaobject.MultiPutFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.ExceptionHandlingFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAExceptionFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAShutdownFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.PdxFunctionTest</class-name>
- </function>
- <function>
- <class-name>javaobject.SingleStrGetFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.executeFunction_SendException</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FunctionExecutionTimeOut</class-name>
- </function>
- </function-service>
- <serialization-registration>
- <instantiator id="5200" >
- <class-name>javaobject.InstantiatorTest</class-name>
- </instantiator>
- </serialization-registration>
-</cache>
+ <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.MultiGetFunction2</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ThinClientRegionExceptionTest</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.MultiPutFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ExceptionHandlingFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAExceptionFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAShutdownFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.PdxFunctionTest</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.SingleStrGetFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.executeFunction_SendException</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
+ </function>
+ </function-service>
+ <serialization-registration>
+ <instantiator id="5200">
+ <class-name>javaobject.InstantiatorTest</class-name>
+ </instantiator>
+ </serialization-registration>
+</cache>
\ No newline at end of file
diff --git a/cppcache/integration-test/resources/func_cacheserver2_pool.xml b/cppcache/integration-test/resources/func_cacheserver2_pool.xml
index 9b90099..fb1e791 100755
--- a/cppcache/integration-test/resources/func_cacheserver2_pool.xml
+++ b/cppcache/integration-test/resources/func_cacheserver2_pool.xml
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,82 +15,74 @@
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="HOST_PORT2">
- <group>ServerGroup1</group>
+<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="HOST_PORT2">
+ <group>ServerGroup1</group>
</cache-server>
- <pdx read-serialized="true" />
+ <pdx read-serialized="true" />
<region name='partition_region'>
- <region-attributes data-policy="partition" >
- <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
+ <region-attributes data-policy="partition">
+ <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
</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.MultiGetFunction2</class-name>
- </function>
- <function>
- <class-name>javaobject.MultiPutFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.ExceptionHandlingFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAExceptionFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAShutdownFunction</class-name>
- </function>
-
- <function>
- <class-name>javaobject.SingleStrGetFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.executeFunction_SendException</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.PdxFunctionTest</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
- </function>
- <function>
- <class-name>javaobject.FunctionExecutionTimeOut</class-name>
- </function>
- <function>
- <class-name>javaobject.ThinClientRegionExceptionTest</class-name>
- </function>
- </function-service>
- <serialization-registration>
- <instantiator id="5200" >
- <class-name>javaobject.InstantiatorTest</class-name>
- </instantiator>
- </serialization-registration>
-</cache>
+ <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.MultiGetFunction2</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.MultiPutFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ExceptionHandlingFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAExceptionFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAShutdownFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.SingleStrGetFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.executeFunction_SendException</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.PdxFunctionTest</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ThinClientRegionExceptionTest</class-name>
+ </function>
+ </function-service>
+ <serialization-registration>
+ <instantiator id="5200">
+ <class-name>javaobject.InstantiatorTest</class-name>
+ </instantiator>
+ </serialization-registration>
+</cache>
\ No newline at end of file
diff --git a/cppcache/integration-test/resources/func_cacheserver3_pool.xml b/cppcache/integration-test/resources/func_cacheserver3_pool.xml
index 39224b9..0383bdb 100755
--- a/cppcache/integration-test/resources/func_cacheserver3_pool.xml
+++ b/cppcache/integration-test/resources/func_cacheserver3_pool.xml
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,74 +15,67 @@
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="HOST_PORT3">
- <group>ServerGroup1</group>
+<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="HOST_PORT3">
+ <group>ServerGroup1</group>
</cache-server>
<region name='partition_region'>
- <region-attributes data-policy="partition" >
- <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
+ <region-attributes data-policy="partition">
+ <partition-attributes redundant-copies="1" startup-recovery-delay="1"/>
</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.RegionOperationsHAFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.ExceptionHandlingFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAExceptionFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.OnServerHAShutdownFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.SingleStrGetFunction</class-name>
- </function>
- <function>
- <class-name>javaobject.executeFunction_SendException</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
- </function>
- <function>
- <class-name>javaobject.ThinClientRegionExceptionTest</class-name>
- </function>
- <function>
- <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
- </function>
- <function>
- <class-name>javaobject.FunctionExecutionTimeOut</class-name>
- </function>
- </function-service>
- <serialization-registration>
- <instantiator id="5200" >
- <class-name>javaobject.InstantiatorTest</class-name>
- </instantiator>
- </serialization-registration>
-</cache>
+ <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.RegionOperationsHAFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ExceptionHandlingFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAExceptionFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.OnServerHAShutdownFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.SingleStrGetFunction</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.executeFunction_SendException</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.FEOnRegionPrSHOP_OptimizeForWrite</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.ThinClientRegionExceptionTest</class-name>
+ </function>
+ <function>
+ <class-name>javaobject.RegionOperationsHAFunctionPrSHOP</class-name>
+ </function>
+ </function-service>
+ <serialization-registration>
+ <instantiator id="5200">
+ <class-name>javaobject.InstantiatorTest</class-name>
+ </instantiator>
+ </serialization-registration>
+</cache>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
echobravo@apache.org.