From commits-return-25582-archive-asf-public=cust-asf.ponee.io@geode.apache.org Thu Feb 8 16:36:12 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 44D0218064F for ; Thu, 8 Feb 2018 16:36:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 34047160C4A; Thu, 8 Feb 2018 15:36:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 33393160C3D for ; Thu, 8 Feb 2018 16:36:11 +0100 (CET) Received: (qmail 48834 invoked by uid 500); 8 Feb 2018 15:36:10 -0000 Mailing-List: contact commits-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list commits@geode.apache.org Received: (qmail 48825 invoked by uid 99); 8 Feb 2018 15:36:10 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2018 15:36:10 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id BEAC9823B0; Thu, 8 Feb 2018 15:36:09 +0000 (UTC) Date: Thu, 08 Feb 2018 15:36:09 +0000 To: "commits@geode.apache.org" Subject: [geode-native] branch develop updated: GEODE-4632: Replace CacheableString with std::string. (#215) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151810416968.18939.968059682260745989@gitbox.apache.org> From: jbarrett@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: geode-native X-Git-Refname: refs/heads/develop X-Git-Reftype: branch X-Git-Oldrev: 647ad26d38237f0ffa3360c89d76aa1da3579cac X-Git-Newrev: 5933abccf2b34fd73369af9ece498f2fdaf34ad4 X-Git-Rev: 5933abccf2b34fd73369af9ece498f2fdaf34ad4 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. jbarrett pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-native.git The following commit(s) were added to refs/heads/develop by this push: new 5933abc GEODE-4632: Replace CacheableString with std::string. (#215) 5933abc is described below commit 5933abccf2b34fd73369af9ece498f2fdaf34ad4 Author: Jacob Barrett AuthorDate: Thu Feb 8 07:36:07 2018 -0800 GEODE-4632: Replace CacheableString with std::string. (#215) --- .../geode/UserFunctionExecutionException.hpp | 78 +++++----------------- .../integration-test/testThinClientPdxTests.cpp | 6 +- .../testThinClientPoolExecuteFunction.cpp | 5 +- .../testThinClientPoolExecuteFunctionPrSHOP.cpp | 5 +- ...hinClientPoolExecuteFunctionThrowsException.cpp | 2 +- .../testThinClientSecurityAuthorizationMU.cpp | 4 +- cppcache/src/ThinClientRegion.cpp | 4 +- cppcache/src/UserFunctionExecutionException.cpp | 3 - 8 files changed, 30 insertions(+), 77 deletions(-) diff --git a/cppcache/include/geode/UserFunctionExecutionException.hpp b/cppcache/include/geode/UserFunctionExecutionException.hpp index 91671eb..94e9d70 100644 --- a/cppcache/include/geode/UserFunctionExecutionException.hpp +++ b/cppcache/include/geode/UserFunctionExecutionException.hpp @@ -20,9 +20,8 @@ #ifndef GEODE_USERFUNCTIONEXECUTIONEXCEPTION_H_ #define GEODE_USERFUNCTIONEXECUTIONEXCEPTION_H_ - - #include +#include #include "CacheableString.hpp" #include "Serializable.hpp" @@ -32,93 +31,52 @@ namespace geode { namespace client { class UserFunctionExecutionException; -class CacheableString; class DataInput; class DataOutput; /** * @brief UserFunctionExecutionException class is used to encapsulate geode - *sendException in case of Function execution. - **/ + * sendException in case of Function execution. + */ class UserFunctionExecutionException : public Serializable { public: - /** - * @brief constructors - */ - explicit UserFunctionExecutionException(std::shared_ptr msg); + explicit UserFunctionExecutionException(std::string message) + : m_message(std::move(message)) {} UserFunctionExecutionException(const UserFunctionExecutionException& other) = delete; void operator=(const UserFunctionExecutionException& other) = delete; - /** - * @brief destructor - */ - virtual ~UserFunctionExecutionException() = default; + ~UserFunctionExecutionException() override = default; - /** - *@brief serialize this object - * @throws IllegalStateException If this api is called from User code. - **/ void toData(DataOutput& output) const override; - /** - *@brief deserialize this object, typical implementation should return - * the 'this' pointer. - * @throws IllegalStateException If this api is called from User code. - **/ virtual void fromData(DataInput& input) override; - /** - *@brief Return the classId of the instance being serialized. - * This is used by deserialization to determine what instance - * type to create and deserialize into. - * - * The classId must be unique within an application suite. - * Using a negative value may result in undefined behavior. - * @throws IllegalStateException If this api is called from User code. - */ virtual int32_t classId() const override; - /** - *@brief return the size in bytes of the instance being serialized. - * This is used to determine whether the cache is using up more - * physical memory than it has been configured to use. The method can - * return zero if the user does not require the ability to control - * cache memory utilization. - * Note that you must implement this only if you use the HeapLRU feature. - * @throws IllegalStateException If this api is called from User code. - */ virtual size_t objectSize() const override; - /** - *@brief return the typeId byte of the instance being serialized. - * This is used by deserialization to determine what instance - * type to create and deserialize into. - * - * Note that this should not be overridden by custom implementations - * and is reserved only for builtin types. - */ virtual int8_t typeId() const override; /** - *@brief return as std::shared_ptr the Exception message - *returned from geode sendException api. - **/ - std::shared_ptr getMessage() { return m_message; } + * @brief return as std::string the Exception message returned from geode + * sendException api. + */ + const std::string& getMessage() const { return m_message; } + + std::string toString() const override { return this->getMessage(); } /** - *@brief return as std::shared_ptr the Exception name - *returned from geode sendException api. - **/ - std::shared_ptr getName() { - static const auto name = - CacheableString::create("UserFunctionExecutionException"); + * @brief return as std::string the Exception name returned from geode + * sendException api. + */ + const std::string& getName() const { + static const std::string name = "UserFunctionExecutionException"; return name; } private: - - std::shared_ptr m_message; // error message + std::string m_message; }; } // namespace client diff --git a/cppcache/integration-test/testThinClientPdxTests.cpp b/cppcache/integration-test/testThinClientPdxTests.cpp index a00f28e..f8b0913 100644 --- a/cppcache/integration-test/testThinClientPdxTests.cpp +++ b/cppcache/integration-test/testThinClientPdxTests.cpp @@ -2461,7 +2461,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, generateJavaPdxType) ASSERT(uFEPtr != nullptr, "uFEPtr exception is nullptr"); LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); } catch (...) { FAIL( "exFuncNameSendException casting to string for bool arguement " @@ -2631,7 +2631,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, verifyDotNetPdxTypes) ASSERT(uFEPtr != nullptr, "uFEPtr exception is nullptr"); LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); } catch (...) { FAIL( "exFuncNameSendException casting to string for bool arguement " @@ -2743,7 +2743,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, client3GetsV2Object) ASSERT(uFEPtr != nullptr, "uFEPtr exception is nullptr"); LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); } catch (...) { FAIL( "exFuncNameSendException casting to string for bool arguement " diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp index b48f29e..539c048 100644 --- a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp +++ b/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp @@ -175,7 +175,7 @@ bool validateResultTypeAndAllowUserFunctionExecutionException( std::dynamic_pointer_cast(result)) { LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); return true; } else { LOGINFO("Unexpected result type %s for index %d.", @@ -191,8 +191,7 @@ bool validateResultTypeIsUserFunctionExecutionException( if (auto uFEPtr = std::dynamic_pointer_cast(result)) { LOGINFO("Done casting to uFEPtr"); - LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + LOGINFO("Read expected uFEPtr exception %s ", uFEPtr->getMessage().c_str()); return true; } else { LOGINFO("Unexpected result type %s for index %d.", diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp index b6ddca9..f7236ec 100644 --- a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp +++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp @@ -178,7 +178,7 @@ bool validateResultTypeAndAllowUserFunctionExecutionException( std::dynamic_pointer_cast(result)) { LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); return true; } else { LOGINFO("Unexpected result type %s for index %d.", @@ -194,8 +194,7 @@ bool validateResultTypeIsUserFunctionExecutionException( if (auto uFEPtr = std::dynamic_pointer_cast(result)) { LOGINFO("Done casting to uFEPtr"); - LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + LOGINFO("Read expected uFEPtr exception %s ", uFEPtr->getMessage().c_str()); return true; } else { LOGINFO("Unexpected result type %s for index %d.", diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp index 6184944..3ac044c 100644 --- a/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp +++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp @@ -265,7 +265,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest) result->operator[](i))) { LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); } else { FAIL( "exFuncNameSendException casting to string for bool argument " diff --git a/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp b/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp index 3aed453..7205f41 100644 --- a/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp +++ b/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp @@ -391,7 +391,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne) ASSERT(uFEPtr != nullptr, "uFEPtr exception is nullptr"); LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); } } catch (ClassCastException& ex) { std::string logmsg = ""; @@ -443,7 +443,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne) ASSERT(uFEPtr != nullptr, "uFEPtr exception is nullptr"); LOGINFO("Done casting to uFEPtr"); LOGINFO("Read expected uFEPtr exception %s ", - uFEPtr->getMessage()->value().c_str()); + uFEPtr->getMessage().c_str()); } catch (...) { FAIL( "exFuncNameSendException casting to string for bool arguement " diff --git a/cppcache/src/ThinClientRegion.cpp b/cppcache/src/ThinClientRegion.cpp index b17a54b..2b78d7d 100644 --- a/cppcache/src/ThinClientRegion.cpp +++ b/cppcache/src/ThinClientRegion.cpp @@ -3701,9 +3701,9 @@ void ChunkedFunctionExecutionResponse::handleChunk( std::shared_ptr result = nullptr; if (isExceptionPart) { result = std::make_shared( - CacheableString::create(value->toString().c_str())); + std::dynamic_pointer_cast(value)->value()); } else { - result = std::dynamic_pointer_cast(value); + result = value; } if (m_resultCollectorLock.get() != 0) { ACE_Guard guard(*m_resultCollectorLock); diff --git a/cppcache/src/UserFunctionExecutionException.cpp b/cppcache/src/UserFunctionExecutionException.cpp index 290c991..0d2c892 100644 --- a/cppcache/src/UserFunctionExecutionException.cpp +++ b/cppcache/src/UserFunctionExecutionException.cpp @@ -48,9 +48,6 @@ int8_t UserFunctionExecutionException::typeId() const { return static_cast(0); } -UserFunctionExecutionException::UserFunctionExecutionException( - std::shared_ptr msg) - : m_message(msg) {} } // namespace client } // namespace geode } // namespace apache -- To stop receiving notification emails like this one, please contact jbarrett@apache.org.