From 2a3824cba206d85d5be5f41fb8ba11e9e8c66805 Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Fri, 15 Nov 2024 18:56:47 +0800 Subject: [PATCH] update generated sdk --- .../protocol/{ServiceType.h => Constant.h} | 3 +- cpp/ppc-framework/protocol/GrpcConfig.h | 42 +- cpp/ppc-framework/protocol/Message.h | 30 +- cpp/wedpr-computing/ppc-psi/src/PSIConfig.h | 10 + .../src/ecdh-multi-psi/EcdhMultiCache.cpp | 63 +- .../src/ecdh-multi-psi/EcdhMultiCache.h | 9 +- .../src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp | 7 +- .../core/EcdhMultiPSICalculator.cpp | 7 +- .../core/EcdhMultiPSIMaster.cpp | 18 +- .../core/EcdhMultiPSIPartner.cpp | 6 +- .../src/psi-framework/PSIFramework.cpp | 9 + .../ppc-psi/src/psi-framework/TaskState.h | 7 +- .../interfaces/PSIMessageInterface.h | 9 +- .../src/psi-framework/protocol/PSI.tars | 2 +- .../src/psi-framework/protocol/PSIMessage.cpp | 10 + .../src/psi-framework/protocol/PSIMessage.h | 53 +- cpp/wedpr-initializer/Initializer.cpp | 2 +- cpp/wedpr-main/mpc-node/MPCInitializer.cpp | 2 +- cpp/wedpr-protocol/grpc/server/GrpcServer.cpp | 14 +- cpp/wedpr-protocol/protocol/src/PPCMessage.h | 2 +- cpp/wedpr-storage/ppc-io/src/CMakeLists.txt | 2 +- .../ppc-storage/src/CMakeLists.txt | 2 +- cpp/wedpr-transport/ppc-front/CMakeLists.txt | 2 +- .../ppc-front/ppc-front/Front.cpp | 57 +- .../ppc-front/ppc-front/FrontImpl.cpp | 4 +- .../wedpr/sdk/jni/generated/GrpcConfig.java | 16 +- .../sdk/jni/generated/GrpcServerConfig.java | 13 +- .../wedpr/sdk/jni/generated/Message.java | 9 +- .../sdk/jni/generated/MessagePayload.java | 4 + .../generated/wedpr_java_transportJNI.java | 65 +- .../src/wedpr_java_transportJAVA_wrap.cxx | 701 ++++++----- .../java/swig/wedpr_java_transport.i | 3 + .../generated/wedpr_python_transport.py | 84 +- .../src/wedpr_python_transportPYTHON_wrap.cxx | 1041 +++++++++-------- .../python/swig/wedpr_python_transport.i | 5 + 35 files changed, 1288 insertions(+), 1025 deletions(-) rename cpp/ppc-framework/protocol/{ServiceType.h => Constant.h} (91%) diff --git a/cpp/ppc-framework/protocol/ServiceType.h b/cpp/ppc-framework/protocol/Constant.h similarity index 91% rename from cpp/ppc-framework/protocol/ServiceType.h rename to cpp/ppc-framework/protocol/Constant.h index 4222064a..fd9b8306 100644 --- a/cpp/ppc-framework/protocol/ServiceType.h +++ b/cpp/ppc-framework/protocol/Constant.h @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * @file ServiceType.h + * @file Constant.h * @author: yujiechen * @date 2024-11-07 */ @@ -26,4 +26,5 @@ namespace ppc::protocol { const static std::string PSI_SERVICE_TYPE = "PSI"; const static std::string MPC_SERVICE_TYPE = "MPC"; +const static size_t LARGE_MSG_THRESHOLD = 30 * 1024 * 1024; } // namespace ppc::protocol diff --git a/cpp/ppc-framework/protocol/GrpcConfig.h b/cpp/ppc-framework/protocol/GrpcConfig.h index c3a2655e..7a5b2f33 100644 --- a/cpp/ppc-framework/protocol/GrpcConfig.h +++ b/cpp/ppc-framework/protocol/GrpcConfig.h @@ -89,10 +89,22 @@ class GrpcConfig m_compressAlgorithm = compressAlgorithm; } + uint64_t maxMsgSize() const { return m_maxMsgSize; } + void setMaxMsgSize(uint64_t maxMsgSize) + { + if (maxMsgSize > c_maxMsgSize) + { + BOOST_THROW_EXCEPTION(WeDPRException() << bcos::errinfo_comment( + "The maxMsgSize limit is " + std::to_string(c_maxMsgSize))); + } + m_maxMsgSize = maxMsgSize; + } + protected: bool m_enableHealthCheck = true; std::string m_loadBalancePolicy = "round_robin"; bool m_enableDnslookup = false; + // Note: grpc use int to set the maxMsgSize uint64_t const c_maxMsgSize = INT_MAX; @@ -100,18 +112,22 @@ class GrpcConfig uint64_t m_maxSendMessageSize = c_maxMsgSize; // the max received message size in bytes uint64_t m_maxReceivedMessageSize = c_maxMsgSize; + // the max msg size + uint64_t m_maxMsgSize = c_maxMsgSize; int m_compressAlgorithm = 0; }; -class GrpcServerConfig : public GrpcConfig +class GrpcServerConfig { public: using Ptr = std::shared_ptr; - GrpcServerConfig() = default; - GrpcServerConfig(EndPoint endPoint, bool enableHealthCheck) - : m_endPoint(std::move(endPoint)), m_enableHealthCheck(enableHealthCheck) - {} - ~GrpcServerConfig() override = default; + GrpcServerConfig() { m_grpcConfig = std::make_shared(); } + GrpcServerConfig(EndPoint endPoint, bool enableHealthCheck) : GrpcServerConfig() + { + m_endPoint = std::move(endPoint); + m_enableHealthCheck = enableHealthCheck; + } + virtual ~GrpcServerConfig() = default; std::string listenEndPoint() const { return m_endPoint.listenEndPoint(); } @@ -122,21 +138,13 @@ class GrpcServerConfig : public GrpcConfig EndPoint& mutableEndPoint() { return m_endPoint; } bool enableHealthCheck() const { return m_enableHealthCheck; } - uint64_t maxMsgSize() const { return m_maxMsgSize; } - void setMaxMsgSize(uint64_t maxMsgSize) - { - if (maxMsgSize > c_maxMsgSize) - { - BOOST_THROW_EXCEPTION(WeDPRException() << bcos::errinfo_comment( - "The maxMsgSize limit is " + std::to_string(c_maxMsgSize))); - } - m_maxMsgSize = maxMsgSize; - } + GrpcConfig::Ptr const& grpcConfig() const { return m_grpcConfig; } protected: ppc::protocol::EndPoint m_endPoint; bool m_enableHealthCheck = true; - uint64_t m_maxMsgSize = c_maxMsgSize; + // the grpc config + GrpcConfig::Ptr m_grpcConfig; }; diff --git a/cpp/ppc-framework/protocol/Message.h b/cpp/ppc-framework/protocol/Message.h index 27dbb08d..205f1ce3 100644 --- a/cpp/ppc-framework/protocol/Message.h +++ b/cpp/ppc-framework/protocol/Message.h @@ -187,8 +187,6 @@ class MessageHeader class Message { public: - const static size_t LARGER_MSG_THRESHOLD = 30 * 1024 * 1024; - using Ptr = std::shared_ptr; Message() = default; virtual ~Message() {} @@ -207,7 +205,14 @@ class Message bool isRespPacket() const { return m_header->isRespPacket(); } void setRespPacket() { m_header->setRespPacket(); } - void setPayload(std::shared_ptr _payload) { m_payload = std::move(_payload); } + void setPayload(std::shared_ptr _payload) + { + m_payload = std::move(_payload); + if (m_payload) + { + m_payloadLen = m_payload->size(); + } + } // for swig wrapper OutputBuffer payloadBuffer() const { @@ -218,9 +223,18 @@ class Message return OutputBuffer{(unsigned char*)m_payload->data(), m_payload->size()}; } - void setFrontMessage(MessagePayload::Ptr frontMessage) + void setFrontMessage(MessagePayload::Ptr frontMessage, bool releasePayload = false) { m_frontMessage = std::move(frontMessage); + if (!releasePayload) + { + return; + } + if (m_payload) + { + m_payload->clear(); + bcos::bytes().swap(*m_payload); + } } MessagePayload::Ptr const& frontMessage() const { return m_frontMessage; } @@ -229,10 +243,7 @@ class Message virtual bool encode(bcos::bytes& _buffer) = 0; virtual int64_t decode(bcos::bytesConstRef _buffer) = 0; - virtual uint32_t length() const - { - return m_header->length() + (m_payload ? m_payload->size() : 0); - } + virtual uint32_t length() const { return m_header->length() + m_payloadLen; } virtual std::shared_ptr payload() const { return m_payload; } @@ -253,6 +264,9 @@ class Message MessageHeader::Ptr m_header; // Note: allocate here in case of wsService nullptr access caused coredump std::shared_ptr m_payload = std::make_shared(); + uint64_t m_payloadLen = 0; + ; + MessagePayload::Ptr m_frontMessage = nullptr; }; diff --git a/cpp/wedpr-computing/ppc-psi/src/PSIConfig.h b/cpp/wedpr-computing/ppc-psi/src/PSIConfig.h index 1b81b545..af8cdf64 100644 --- a/cpp/wedpr-computing/ppc-psi/src/PSIConfig.h +++ b/cpp/wedpr-computing/ppc-psi/src/PSIConfig.h @@ -23,8 +23,10 @@ #include "ppc-framework/Helper.h" #include "ppc-framework/front/FrontInterface.h" #include "ppc-framework/io/DataResourceLoader.h" +#include "ppc-framework/protocol/Constant.h" #include "ppc-framework/protocol/Protocol.h" #include "psi-framework/interfaces/PSIMessageInterface.h" +#include #include #include @@ -95,6 +97,14 @@ class PSIConfig } }, _responseCallback); + // release the large buffer if no-need to use + if (ppcMsg->data() && ppcMsg->data()->size() > ppc::protocol::LARGE_MSG_THRESHOLD) + { + PSI_LOG(INFO) << LOG_DESC("sendMsg: Release large buffer since the message") + << LOG_KV("size", ppcMsg->data()->size()); + ppcMsg->releasePayload(); + MallocExtension::instance()->ReleaseFreeMemory(); + } } void asyncSendResponse(bcos::bytes const& fromNode, std::string const& _taskID, diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.cpp index 0d719531..bdc515af 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.cpp @@ -24,8 +24,8 @@ using namespace ppc::psi; using namespace bcos; -void MasterCache::addCalculatorCipher(std::string _peerId, - std::map&& _cipherData, uint32_t seq, uint32_t dataBatchCount) +void MasterCache::addCalculatorCipher(std::string _peerId, std::vector&& _cipherData, + std::vector const& dataIndex, uint32_t seq, uint32_t dataBatchCount) { auto peerIndex = getPeerIndex(_peerId); if (peerIndex == -1) @@ -39,9 +39,11 @@ void MasterCache::addCalculatorCipher(std::string _peerId, { m_calculatorDataBatchCount = dataBatchCount; } + uint64_t i = 0; for (auto&& it : _cipherData) { - updateMasterDataRef(peerIndex, std::move(it.second), it.first); + updateMasterDataRef(peerIndex, std::move(it), dataIndex[i]); + i++; } // try to merge the if (m_calculatorDataBatchCount > 0 && @@ -62,7 +64,7 @@ void MasterCache::addCalculatorCipher(std::string _peerId, << LOG_KV("dataBatchCount", m_calculatorDataBatchCount); // release the cipherData _cipherData.clear(); - std::map().swap(_cipherData); + std::vector().swap(_cipherData); MallocExtension::instance()->ReleaseFreeMemory(); } @@ -184,8 +186,8 @@ bool MasterCache::tryToIntersection() } m_cacheState = CacheState::IntersectionProgressing; - ECDH_MULTI_LOG(INFO) << LOG_DESC("tryToIntersection ") << printCacheState() - << LOG_KV("masterData", m_masterDataRef.size()); + ECDH_MULTI_LOG(INFO) << LOG_DESC("* tryToIntersection ") << printCacheState() + << LOG_KV("* masterData", m_masterDataRef.size()); auto startT = utcSteadyTime(); // iterator the masterDataRef to obtain intersection for (auto&& it : m_masterDataRef) @@ -208,30 +210,32 @@ bool MasterCache::tryToIntersection() } releaseCache(); m_cacheState = CacheState::Intersectioned; - ECDH_MULTI_LOG(INFO) << LOG_DESC("tryToIntersection success") << printCacheState() - << LOG_KV("intersectionSize", m_intersecCipher.size()) - << LOG_KV("timecost", (utcSteadyTime() - startT)); + ECDH_MULTI_LOG(INFO) << LOG_DESC("* tryToIntersection success") << printCacheState() + << LOG_KV("* intersectionSize", m_intersecCipher.size()) + << LOG_KV("* timecost", (utcSteadyTime() - startT)); return true; } -std::vector> MasterCache::encryptIntersection( - bcos::bytes const& randomKey) +PSIMessageInterface::Ptr MasterCache::encryptIntersection(bcos::bytes const& randomKey) { - std::vector> cipherData(m_intersecCipher.size()); + auto message = m_config->psiMsgFactory()->createPSIMessage( + uint32_t(EcdhMultiPSIMessageType::SEND_ENCRYPTED_INTERSECTION_SET_TO_CALCULATOR)); + message->setFrom(m_taskState->task()->selfParty()->id()); + message->resizeData(m_intersecCipher.size()); tbb::parallel_for( tbb::blocked_range(0U, m_intersecCipher.size()), [&](auto const& range) { for (auto i = range.begin(); i < range.end(); i++) { auto cipherValue = m_config->eccCrypto()->ecMultiply(m_intersecCipher[i], randomKey); - cipherData[i] = std::make_pair(m_intersecCipherIndex[i], cipherValue); + message->setDataPair(i, m_intersecCipherIndex[i], cipherValue); } }); + ECDH_MULTI_LOG(INFO) << LOG_DESC("encryptIntersection") + << LOG_KV("cipherCount", m_intersecCipher.size()) << printCacheState(); // Note: release the m_intersecCipher, make share it not been used after released releaseItersection(); - ECDH_MULTI_LOG(INFO) << LOG_DESC("encryptIntersection") - << LOG_KV("cipherCount", cipherData.size()) << printCacheState(); - return cipherData; + return message; } bcos::bytes CalculatorCache::getPlainDataByIndex(uint64_t index) @@ -257,8 +261,8 @@ bool CalculatorCache::tryToFinalize() return false; } auto startT = utcSteadyTime(); - ECDH_MULTI_LOG(INFO) << LOG_DESC("tryToFinalize: compute intersection") - << LOG_KV("cipherRef", m_cipherRef.size()) << printCacheState(); + ECDH_MULTI_LOG(INFO) << LOG_DESC("* tryToFinalize: compute intersection") + << LOG_KV("* cipherRef", m_cipherRef.size()) << printCacheState(); m_cacheState = CacheState::Finalizing; // find the intersection for (auto const& it : m_cipherRef) @@ -273,13 +277,13 @@ bool CalculatorCache::tryToFinalize() } } m_cacheState = CacheState::Finalized; - ECDH_MULTI_LOG(INFO) << LOG_DESC("tryToFinalize: compute intersection success") - << printCacheState() << LOG_KV("cipherRef", m_cipherRef.size()) - << LOG_KV("intersectionSize", m_intersectionResult.size()) - << LOG_KV("timecost", (utcSteadyTime() - startT)); + ECDH_MULTI_LOG(INFO) << LOG_DESC("* tryToFinalize: compute intersection success") + << printCacheState() << LOG_KV("* cipherRef", m_cipherRef.size()) + << LOG_KV("* intersectionSize", m_intersectionResult.size()) + << LOG_KV("* timecost", (utcSteadyTime() - startT)); releaseDataAfterFinalize(); - ECDH_MULTI_LOG(INFO) << LOG_DESC("tryToFinalize: syncIntersections") << printCacheState(); + ECDH_MULTI_LOG(INFO) << LOG_DESC("* tryToFinalize: syncIntersections") << printCacheState(); m_cacheState = CacheState::Syncing; syncIntersections(); m_cacheState = CacheState::Synced; @@ -287,14 +291,14 @@ bool CalculatorCache::tryToFinalize() m_cacheState = CacheState::StoreProgressing; m_taskState->storePSIResult(m_config->dataResourceLoader(), m_intersectionResult); m_cacheState = CacheState::Stored; - ECDH_MULTI_LOG(INFO) << LOG_DESC("tryToFinalize: syncIntersections and store success") + ECDH_MULTI_LOG(INFO) << LOG_DESC("* tryToFinalize: syncIntersections and store success") << printCacheState(); return true; } void CalculatorCache::syncIntersections() { - ECDH_MULTI_LOG(INFO) << LOG_DESC("syncIntersections") << printCacheState(); + ECDH_MULTI_LOG(INFO) << LOG_DESC("*** syncIntersections **") << printCacheState(); auto peers = m_taskState->task()->getAllPeerParties(); auto taskID = m_taskState->task()->id(); // notify task result @@ -398,21 +402,24 @@ bool CalculatorCache::appendMasterCipher( return m_receiveAllMasterCipher; } -void CalculatorCache::setIntersectionCipher(std::map&& _cipherData) +void CalculatorCache::setIntersectionCipher( + std::vector&& _cipherData, std::vector const& dataIndex) { ECDH_MULTI_LOG(INFO) << LOG_DESC("setIntersectionCipher") << LOG_KV("dataSize", _cipherData.size()) << LOG_KV("cipherRefSize", m_cipherRef.size()) << printCacheState(); bcos::Guard lock(m_mutex); + uint64_t i = 0; for (auto&& it : _cipherData) { - updateCipherRef(std::move(it.second), it.first); + updateCipherRef(std::move(it), dataIndex[i]); + i++; } m_receiveIntersection = true; ECDH_MULTI_LOG(INFO) << LOG_DESC("setIntersectionCipher finshed") << LOG_KV("cipherRefSize", m_cipherRef.size()) << printCacheState(); // release the cipherData _cipherData.clear(); - std::map().swap(_cipherData); + std::vector().swap(_cipherData); MallocExtension::instance()->ReleaseFreeMemory(); } \ No newline at end of file diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h index 7f84dc38..1dabf793 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.h @@ -67,8 +67,8 @@ class MasterCache << LOG_KV("taskID", m_taskState->task()->id()); } - void addCalculatorCipher(std::string _peerId, std::map&& _cipherData, - uint32_t seq, uint32_t dataBatchCount); + void addCalculatorCipher(std::string _peerId, std::vector&& _cipherData, + std::vector const& dataIndex, uint32_t seq, uint32_t dataBatchCount); void addPartnerCipher(std::string _peerId, std::vector&& _cipherData, uint32_t seq, uint32_t parternerDataCount); @@ -83,7 +83,7 @@ class MasterCache return stringstream.str(); } - std::vector> encryptIntersection(bcos::bytes const& randomKey); + PSIMessageInterface::Ptr encryptIntersection(bcos::bytes const& randomKey); private: bool shouldIntersection() @@ -218,7 +218,8 @@ class CalculatorCache bool appendMasterCipher( std::vector&& _cipherData, uint32_t seq, uint32_t dataBatchSize); - void setIntersectionCipher(std::map&& _cipherData); + void setIntersectionCipher( + std::vector&& _cipherData, std::vector const& dataIndex); void appendPlainData(ppc::io::DataBatch::Ptr const& data) { diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp index 0b9988c9..139fb4a5 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp @@ -1,5 +1,6 @@ #include "EcdhMultiPSIImpl.h" #include "Common.h" +#include "ppc-framework/protocol/Constant.h" #include using namespace ppc::psi; @@ -314,10 +315,10 @@ void EcdhMultiPSIImpl::executeWorker() psiMsg->setUUID(pop_msg->uuid()); ECDH_MULTI_LOG(TRACE) << LOG_DESC("onReceiveMessage") << printPSIMessage(psiMsg) << LOG_KV("uuid", psiMsg->uuid()); - // release the larger payload immediately - if (payLoad->size() >= ppc::protocol::Message::LARGER_MSG_THRESHOLD) + // release the large payload immediately + if (payLoad && payLoad->size() >= ppc::protocol::LARGE_MSG_THRESHOLD) { - ECDH_MULTI_LOG(INFO) << LOG_DESC("Release larger message payload") + ECDH_MULTI_LOG(INFO) << LOG_DESC("Release large message payload") << LOG_KV("size", payLoad->size()); pop_msg->releasePayload(); MallocExtension::instance()->ReleaseFreeMemory(); diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSICalculator.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSICalculator.cpp index b03cc7ca..c4902603 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSICalculator.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSICalculator.cpp @@ -133,7 +133,7 @@ void EcdhMultiPSICalculator::blindData(std::string _taskID, bcos::bytes _randA) << LOG_KV("task", m_taskState->task()->id()); auto message = m_config->psiMsgFactory()->createPSIMessage( uint32_t(EcdhMultiPSIMessageType::SEND_ENCRYPTED_SET_TO_MASTER_FROM_CALCULATOR)); - message->constructDataMap(encryptedData, dataOffset); + message->constructData(encryptedData, dataOffset); // release the encryptedData std::vector().swap(encryptedData); message->setFrom(m_taskState->task()->selfParty()->id()); @@ -204,12 +204,13 @@ void EcdhMultiPSICalculator::initTask(ppc::protocol::Task::ConstPtr _task) // Part3: Calculator store Intersection_XY^b <- Master (response) void EcdhMultiPSICalculator::onReceiveIntersecCipher(PSIMessageInterface::Ptr _msg) { - auto cipherData = _msg->takeDataMap(); + auto cipherData = _msg->takeData(); + auto const& dataIndex = _msg->dataIndex(); ECDH_CAL_LOG(INFO) << LOG_DESC("onReceiveIntersecCipher") << printPSIMessage(_msg) << LOG_KV("dataSize", cipherData.size()); try { - m_calculatorCache->setIntersectionCipher(std::move(cipherData)); + m_calculatorCache->setIntersectionCipher(std::move(cipherData), dataIndex); auto message = m_config->psiMsgFactory()->createPSIMessage(uint32_t( EcdhMultiPSIMessageType::RETURN_ENCRYPTED_INTERSECTION_SET_FROM_CALCULATOR_TO_MASTER)); message->setFrom(m_taskState->task()->selfParty()->id()); diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp index f0ae763e..c9925b38 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp @@ -69,8 +69,10 @@ void EcdhMultiPSIMaster::onReceiveCalCipher(PSIMessageInterface::Ptr _msg) try { ECDH_MASTER_LOG(INFO) << LOG_DESC("onReceiveCalCipher") << printPSIMessage(_msg); + auto&& data = _msg->takeData(); + auto const& dataIndex = _msg->dataIndex(); m_masterCache->addCalculatorCipher( - _msg->from(), _msg->takeDataMap(), _msg->seq(), _msg->dataBatchCount()); + _msg->from(), std::move(data), dataIndex, _msg->seq(), _msg->dataBatchCount()); auto ret = m_masterCache->tryToIntersection(); if (!ret) { @@ -90,17 +92,12 @@ void EcdhMultiPSIMaster::onReceiveCalCipher(PSIMessageInterface::Ptr _msg) void EcdhMultiPSIMaster::encAndSendIntersectionData() { ECDH_MASTER_LOG(INFO) << LOG_DESC("encAndSendIntersectionData") << LOG_KV("taskID", m_taskID); - auto encryptedData = m_masterCache->encryptIntersection(*m_randomB); - auto message = m_config->psiMsgFactory()->createPSIMessage( - uint32_t(EcdhMultiPSIMessageType::SEND_ENCRYPTED_INTERSECTION_SET_TO_CALCULATOR)); - message->constructDataMap(encryptedData); - message->setFrom(m_taskState->task()->selfParty()->id()); + auto message = m_masterCache->encryptIntersection(*m_randomB); + ECDH_MASTER_LOG(INFO) << LOG_DESC("send intersection cipher to calculator") + << LOG_KV("taskID", m_taskState->task()->id()) + << LOG_KV("intersectionSize", message->getDataCount()); for (auto& calcultor : m_calculatorParties) { - ECDH_MASTER_LOG(INFO) << LOG_DESC("send intersection cipher to calculator") - << LOG_KV("taskID", m_taskState->task()->id()) - << LOG_KV("intersectionSize", encryptedData.size()) - << LOG_KV("target", calcultor.first); m_config->generateAndSendPPCMessage(calcultor.first, m_taskID, message, [self = weak_from_this()](bcos::Error::Ptr&& _error) { if (!_error) @@ -193,6 +190,7 @@ void EcdhMultiPSIMaster::blindData() dataBatch->release(); ECDH_MASTER_LOG(INFO) << LOG_DESC("blindData: encrypt data success") << LOG_KV("dataSize", cipher.size()) << LOG_KV("task", m_taskID) + << LOG_KV("seq", seq) << LOG_KV("timecost", (utcSteadyTime() - startT)); ECDH_MASTER_LOG(INFO) << LOG_DESC("blindData: send encrypted data to all calculator") diff --git a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp index f98b7fb7..1853b8e6 100644 --- a/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIPartner.cpp @@ -79,9 +79,9 @@ void EcdhMultiPSIPartner::onReceiveRandomA(bcos::bytesPointer _randA) m_taskState->setFinished(true); } } - ECDH_PARTNER_LOG(INFO) - << LOG_DESC("blindData: encode parterner cipher") - << LOG_KV("size", dataBatch->size()) << printTaskInfo(m_taskState->task()); + ECDH_PARTNER_LOG(INFO) << LOG_DESC("blindData: encode parterner cipher") + << LOG_KV("size", dataBatch->size()) << LOG_KV("seq", seq) + << LOG_KV("task", m_taskState->task()->id()); auto startT = utcSteadyTime(); std::vector cipherData(dataBatch->size()); tbb::parallel_for( diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/PSIFramework.cpp b/cpp/wedpr-computing/ppc-psi/src/psi-framework/PSIFramework.cpp index 6010656e..c7dbc3e1 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/PSIFramework.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/PSIFramework.cpp @@ -19,6 +19,7 @@ */ #include "PSIFramework.h" #include "../Common.h" +#include "ppc-framework/protocol/Constant.h" #include "ppc-framework/protocol/GlobalConfig.h" using namespace ppc::task; @@ -154,6 +155,14 @@ void PSIFramework::onReceiveMessage(PPCMessageFace::Ptr _msg) m_msgQueue->push(psiMsg); PSI_FRAMEWORK_LOG(TRACE) << LOG_DESC("onReceiveMessage") << printPSIMessage(psiMsg) << LOG_KV("uuid", _msg->uuid()); + // release the large payload immediately + if (payLoad && payLoad->size() >= ppc::protocol::LARGE_MSG_THRESHOLD) + { + PSI_FRAMEWORK_LOG(INFO) + << LOG_DESC("Release large message payload") << LOG_KV("size", payLoad->size()); + _msg->releasePayload(); + MallocExtension::instance()->ReleaseFreeMemory(); + } // notify to handle the message m_signalled.notify_all(); } diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/TaskState.h b/cpp/wedpr-computing/ppc-psi/src/psi-framework/TaskState.h index af64b340..1de20188 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/TaskState.h +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/TaskState.h @@ -50,7 +50,7 @@ class TaskState : public std::enable_shared_from_this virtual ~TaskState() { - PSI_LOG(INFO) << LOG_DESC("TaskState Destructor") << LOG_KV("task", m_task->id()); + PSI_LOG(INFO) << LOG_DESC("** TaskState Destructor") << LOG_KV("task", m_task->id()); } ppc::task::TaskResponseCallback const& callback() { return m_callback; } @@ -368,8 +368,9 @@ class TaskState : public std::enable_shared_from_this m_writer->writeLine(dataBatch, ppc::io::DataSchema::Bytes); m_writer->flush(); PSI_LOG(INFO) << LOG_DESC("**** storePSIResult success ****") - << LOG_KV("*task", m_task->id()) << LOG_KV("*IntersectionCount", _data.size()) - << LOG_KV("TaskTimecost", taskPendingTime()); + << LOG_KV("* task", m_task->id()) + << LOG_KV("* IntersectionCount", _data.size()) + << LOG_KV("* TaskTimecost", taskPendingTime()); } std::function takeFinalizeHandler() { return std::move(m_finalizeHandler); } diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/interfaces/PSIMessageInterface.h b/cpp/wedpr-computing/ppc-psi/src/psi-framework/interfaces/PSIMessageInterface.h index b03815d7..1f779927 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/interfaces/PSIMessageInterface.h +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/interfaces/PSIMessageInterface.h @@ -44,21 +44,22 @@ class PSIMessageInterface virtual int32_t version() const = 0; // get all the data virtual std::vector takeData() = 0; - virtual void setDataMap(std::map&& _map) = 0; - virtual void constructDataMap(std::vector const& data, uint64_t startIndex) = 0; - virtual void constructDataMap(std::vector> const& data) = 0; - virtual std::map takeDataMap() = 0; + virtual void constructData(std::vector const& data, uint64_t startIndex) = 0; + virtual std::vector const& dataIndex() const = 0; // Note: can't call this after takeData virtual uint64_t dataSize() const = 0; // get the data item // Note: must ensure the object will not released before access the function virtual bcos::bytesConstRef getData(uint64_t _index) = 0; + virtual uint64_t getDataCount() const = 0; virtual void setPartyID(std::string const& _partyID) = 0; virtual void setResourceID(std::string const& _resourceID) = 0; virtual void setVersion(int32_t _version) = 0; virtual void setData(std::vector const& _data) = 0; virtual void setData(std::vector&& _data) = 0; + virtual void setDataPair(uint64_t pos, uint64_t dataIndex, bcos::bytes const& data) = 0; + virtual void resizeData(uint64_t size) = 0; // copy [_offset, _offset + _len) into the data-field virtual void setData( std::vector const& _data, uint64_t _offset, uint64_t _len) = 0; diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSI.tars b/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSI.tars index 13645e10..a1f459d5 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSI.tars +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSI.tars @@ -13,7 +13,7 @@ module ppctars{ 3 optional string partyID; 4 optional string resourceID; 5 optional vector> data; - 6 optional map> dataMap; + 6 optional vector dataIndex; 7 optional int errorCode; 8 optional string errorMessage; 9 optional vector taskList; diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.cpp b/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.cpp index 376a9f91..336bafdf 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.cpp +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.cpp @@ -19,10 +19,20 @@ */ #include "PSIMessage.h" #include "wedpr-protocol/tars/Common.h" +#include using namespace ppc::psi; using namespace bcos; +// destructor the psi message +PSIMessage::~PSIMessage() +{ + m_inner()->data.clear(); + m_inner()->dataIndex.clear(); + std::vector>().swap(m_inner()->data); + std::vector().swap(m_inner()->dataIndex); + MallocExtension::instance()->ReleaseFreeMemory(); +} // encode the PSIMessage bytesPointer PSIMessage::encode() const { diff --git a/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.h b/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.h index dffda6f0..ed34d6c9 100644 --- a/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.h +++ b/cpp/wedpr-computing/ppc-psi/src/psi-framework/protocol/PSIMessage.h @@ -36,7 +36,7 @@ class PSIMessage : virtual public PSIMessageInterface explicit PSIMessage(bcos::bytesConstRef _data) : PSIMessage() { decode(_data); } explicit PSIMessage(std::function _inner) : m_inner(std::move(_inner)) {} - ~PSIMessage() {} + ~PSIMessage(); // the packet-type uint32_t packetType() const override { return m_inner()->packetType; } @@ -62,18 +62,18 @@ class PSIMessage : virtual public PSIMessageInterface return result; } - std::map takeDataMap() override + std::vector const& dataIndex() const override { return m_inner()->dataIndex; } + + void resizeData(uint64_t size) override { - std::map result; - for (auto& val : m_inner()->dataMap) - { - if (val.second.data()) - { - result[val.first].assign( - m_inner()->dataMap[val.first].begin(), m_inner()->dataMap[val.first].end()); - } - } - return result; + m_inner()->data.resize(size); + m_inner()->dataIndex.resize(size); + } + + void setDataPair(uint64_t pos, uint64_t dataIndex, bcos::bytes const& data) override + { + m_inner()->dataIndex[pos] = dataIndex; + m_inner()->data[pos].assign(data.begin(), data.end()); } // Note: must ensure the object will not released before access the function @@ -82,6 +82,8 @@ class PSIMessage : virtual public PSIMessageInterface auto const& dataItem = m_inner()->data.at(_index); return bcos::bytesConstRef((const bcos::byte*)(dataItem.data()), dataItem.size()); } + + uint64_t getDataCount() const override { return m_inner()->data.size(); } void setPartyID(std::string const& _partyID) override { m_inner()->partyID = _partyID; } void setResourceID(std::string const& _resourceID) override { @@ -118,33 +120,16 @@ class PSIMessage : virtual public PSIMessageInterface } } - void setDataMap(std::map&& _map) override + void constructData(std::vector const& data, uint64_t startIndex) override { - m_inner()->dataMap.clear(); - for (auto& val : _map) - { - m_inner()->dataMap[val.first].assign(val.second.begin(), val.second.end()); - } - } - - void constructDataMap(std::vector const& data, uint64_t startIndex) override - { - m_inner()->dataMap.clear(); - int i = startIndex; + m_inner()->dataIndex.clear(); + int64_t i = startIndex; for (auto const& it : data) { - m_inner()->dataMap[i].assign(it.begin(), it.end()); + m_inner()->dataIndex.emplace_back(i); i++; } - } - - void constructDataMap(std::vector> const& data) override - { - m_inner()->dataMap.clear(); - for (auto const& it : data) - { - m_inner()->dataMap[it.first].assign(it.second.begin(), it.second.end()); - } + setData(data); } void appendData(bcos::bytes const& _dataItem) override diff --git a/cpp/wedpr-initializer/Initializer.cpp b/cpp/wedpr-initializer/Initializer.cpp index 491f9517..9c1c0a78 100644 --- a/cpp/wedpr-initializer/Initializer.cpp +++ b/cpp/wedpr-initializer/Initializer.cpp @@ -32,7 +32,7 @@ //TODO: optimize here to implement EcdhConnPSI #include "ppc-psi/src/ecdh-conn-psi/EcdhConnPSIFactory.h" #endif -#include "ppc-framework/protocol/ServiceType.h" +#include "ppc-framework/protocol/Constant.h" #include "ppc-front/Front.h" #include "ppc-front/FrontConfigImpl.h" #include "ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIFactory.h" diff --git a/cpp/wedpr-main/mpc-node/MPCInitializer.cpp b/cpp/wedpr-main/mpc-node/MPCInitializer.cpp index e1fda6f0..08e03224 100644 --- a/cpp/wedpr-main/mpc-node/MPCInitializer.cpp +++ b/cpp/wedpr-main/mpc-node/MPCInitializer.cpp @@ -19,7 +19,7 @@ */ #include "MPCInitializer.h" #include "ppc-framework/front/FrontConfig.h" -#include "ppc-framework/protocol/ServiceType.h" +#include "ppc-framework/protocol/Constant.h" #include "ppc-mpc/src/MPCService.h" #include "ppc-tools/src/config/PPCConfig.h" #include "wedpr-protocol/protocol/src/ServiceConfig.h" diff --git a/cpp/wedpr-protocol/grpc/server/GrpcServer.cpp b/cpp/wedpr-protocol/grpc/server/GrpcServer.cpp index eb778d8e..6013a920 100644 --- a/cpp/wedpr-protocol/grpc/server/GrpcServer.cpp +++ b/cpp/wedpr-protocol/grpc/server/GrpcServer.cpp @@ -44,9 +44,9 @@ void GrpcServer::start() builder.AddChannelArgument(GRPC_ARG_ALLOW_REUSEPORT, 0); // without authentication builder.AddListeningPort(m_config->listenEndPoint(), grpc::InsecureServerCredentials()); - builder.SetMaxMessageSize(m_config->maxMsgSize()); - builder.SetMaxSendMessageSize(m_config->maxSendMessageSize()); - builder.SetMaxReceiveMessageSize(m_config->maxReceivedMessageSize()); + builder.SetMaxMessageSize(m_config->grpcConfig()->maxMsgSize()); + builder.SetMaxSendMessageSize(m_config->grpcConfig()->maxSendMessageSize()); + builder.SetMaxReceiveMessageSize(m_config->grpcConfig()->maxReceivedMessageSize()); // register the service for (auto const& service : m_bindingServices) { @@ -67,9 +67,11 @@ void GrpcServer::start() } GRPC_SERVER_LOG(INFO) << LOG_DESC("GrpcServer start success!") << LOG_KV("listenEndPoint", m_config->listenEndPoint()) - << LOG_KV("maxMsgSize", m_config->maxMsgSize()) - << LOG_KV("maxSendMessageSize", m_config->maxSendMessageSize()) - << LOG_KV("maxReceivedMessageSize", m_config->maxReceivedMessageSize()); + << LOG_KV("maxMsgSize", m_config->grpcConfig()->maxMsgSize()) + << LOG_KV( + "maxSendMessageSize", m_config->grpcConfig()->maxSendMessageSize()) + << LOG_KV("maxReceivedMessageSize", + m_config->grpcConfig()->maxReceivedMessageSize()); } void GrpcServer::stop() diff --git a/cpp/wedpr-protocol/protocol/src/PPCMessage.h b/cpp/wedpr-protocol/protocol/src/PPCMessage.h index e40a2a04..c2ad3d29 100644 --- a/cpp/wedpr-protocol/protocol/src/PPCMessage.h +++ b/cpp/wedpr-protocol/protocol/src/PPCMessage.h @@ -43,7 +43,7 @@ class PPCMessage : public PPCMessageFace using Ptr = std::shared_ptr; PPCMessage() { m_data = std::make_shared(); } - ~PPCMessage() override = default; + ~PPCMessage() override { releasePayload(); } uint8_t version() const override { return m_version; } void setVersion(uint8_t _version) override { m_version = _version; } diff --git a/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt b/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt index 549a36b3..a730f0de 100644 --- a/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-io/src/CMakeLists.txt @@ -1,4 +1,4 @@ file(GLOB_RECURSE SRCS *.cpp) add_library(${IO_TARGET} ${SRCS}) # Note: the DataBatch depends on tbb -target_link_libraries(${IO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${BCOS_BOOSTSSL_TARGET} ${HDFS_LIB} ${CPU_FEATURES_LIB} TCMalloc) \ No newline at end of file +target_link_libraries(${IO_TARGET} PUBLIC ${BCOS_UTILITIES_TARGET} ${BCOS_BOOSTSSL_TARGET} TCMalloc ${HDFS_LIB} ${CPU_FEATURES_LIB}) \ No newline at end of file diff --git a/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt b/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt index 546372ff..ce85047c 100644 --- a/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt +++ b/cpp/wedpr-storage/ppc-storage/src/CMakeLists.txt @@ -4,4 +4,4 @@ add_library(${STORAGE_TARGET} ${SRCS}) find_package(redis++ REQUIRED) find_package(unofficial-mysql-connector-cpp REQUIRED) -target_link_libraries(${STORAGE_TARGET} PUBLIC ${BCOS_BOOSTSSL_TARGET} redis++::redis++_static unofficial::mysql-connector-cpp::connector resolv ${HDFS_LIB} TCMalloc) +target_link_libraries(${STORAGE_TARGET} PUBLIC ${BCOS_BOOSTSSL_TARGET} redis++::redis++_static TCMalloc unofficial::mysql-connector-cpp::connector resolv ${HDFS_LIB}) diff --git a/cpp/wedpr-transport/ppc-front/CMakeLists.txt b/cpp/wedpr-transport/ppc-front/CMakeLists.txt index efd94094..8966cbae 100644 --- a/cpp/wedpr-transport/ppc-front/CMakeLists.txt +++ b/cpp/wedpr-transport/ppc-front/CMakeLists.txt @@ -4,7 +4,7 @@ aux_source_directory(ppc-front SRCS) add_library(${FRONT_TARGET} ${SRCS}) -target_link_libraries(${FRONT_TARGET} PUBLIC ${TARS_PROTOCOL_TARGET} TBB::tbb TCMalloc) +target_link_libraries(${FRONT_TARGET} PUBLIC ${TARS_PROTOCOL_TARGET} TBB::tbb) #if (TESTS) # enable_testing() diff --git a/cpp/wedpr-transport/ppc-front/ppc-front/Front.cpp b/cpp/wedpr-transport/ppc-front/ppc-front/Front.cpp index 1389af36..4f1fedb1 100644 --- a/cpp/wedpr-transport/ppc-front/ppc-front/Front.cpp +++ b/cpp/wedpr-transport/ppc-front/ppc-front/Front.cpp @@ -19,8 +19,8 @@ */ #include "Front.h" #include "FrontImpl.h" +#include "ppc-framework/protocol/Constant.h" #include "ppc-utilities/Utilities.h" -#include using namespace ppc; using namespace bcos; @@ -173,38 +173,37 @@ void Front::registerMessageHandler(uint8_t _taskType, uint8_t _algorithmType, { uint16_t type = ((uint16_t)_taskType << 8) | _algorithmType; auto self = weak_from_this(); - m_front->registerMessageHandler( - std::to_string(type), [self, type, _handler](ppc::protocol::Message::Ptr msg) { - auto front = self.lock(); - if (!front) + m_front->registerMessageHandler(std::to_string(type), [self, type, _handler]( + ppc::protocol::Message::Ptr msg) { + auto front = self.lock(); + if (!front) + { + return; + } + try + { + if (msg == nullptr) { + _handler(nullptr); return; } - try + _handler(front->m_messageFactory->decodePPCMessage(msg)); + auto length = msg->length(); + // release the payload of the large packet after the msg decoded + if (length >= ppc::protocol::LARGE_MSG_THRESHOLD) { - if (msg == nullptr) - { - _handler(nullptr); - return; - } - _handler(front->m_messageFactory->decodePPCMessage(msg)); - auto length = msg->length(); - // release the payload of the larger packet after the msg decoded - if (length >= ppc::protocol::Message::LARGER_MSG_THRESHOLD) - { - FRONT_LOG(INFO) << LOG_DESC("Release larger payload for node after used") - << LOG_KV("msgSize", length); - // release the payload - msg->releasePayload(); - MallocExtension::instance()->ReleaseFreeMemory(); - } - } - catch (std::exception const& e) - { - FRONT_LOG(WARNING) << LOG_DESC("Call handler for component failed") - << LOG_KV("componentType", type) - << LOG_KV("error", boost::diagnostic_information(e)); + FRONT_LOG(INFO) << LOG_DESC("RecvMsg: Release large payload for node after used") + << LOG_KV("msgSize", length); + // release the payload + msg->releasePayload(); } - }); + } + catch (std::exception const& e) + { + FRONT_LOG(WARNING) << LOG_DESC("Call handler for component failed") + << LOG_KV("componentType", type) + << LOG_KV("error", boost::diagnostic_information(e)); + } + }); m_front->registerComponent(std::to_string(type)); } \ No newline at end of file diff --git a/cpp/wedpr-transport/ppc-front/ppc-front/FrontImpl.cpp b/cpp/wedpr-transport/ppc-front/ppc-front/FrontImpl.cpp index 4ff6ed09..0441d1fa 100644 --- a/cpp/wedpr-transport/ppc-front/ppc-front/FrontImpl.cpp +++ b/cpp/wedpr-transport/ppc-front/ppc-front/FrontImpl.cpp @@ -265,7 +265,9 @@ void FrontImpl::onReceiveMessage(Message::Ptr const& msg, ReceiveMsgFunc callbac } FRONT_LOG(TRACE) << LOG_BADGE("onReceiveMessage") << LOG_KV("msg", printMessage(msg)); auto frontMessage = m_messageFactory->build(bcos::ref(*(msg->payload()))); - msg->setFrontMessage(frontMessage); + // release the payload buffer since it useless now + msg->setFrontMessage(frontMessage, true); + // the response packet, dispatcher by callback if (frontMessage->isRespPacket()) { diff --git a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcConfig.java b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcConfig.java index 9668c795..5860ec62 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcConfig.java +++ b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcConfig.java @@ -25,16 +25,12 @@ protected void swigSetCMemOwn(boolean own) { swigCMemOwn = own; } - @SuppressWarnings({"deprecation", "removal"}) - protected void finalize() { - delete(); - } - public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; - wedpr_java_transportJNI.delete_GrpcConfig(swigCPtr); + throw new UnsupportedOperationException( + "C++ destructor does not have public access"); } swigCPtr = 0; } @@ -93,4 +89,12 @@ public int compressAlgorithm() { public void setCompressAlgorithm(int compressAlgorithm) { wedpr_java_transportJNI.GrpcConfig_setCompressAlgorithm(swigCPtr, this, compressAlgorithm); } + + public java.math.BigInteger maxMsgSize() { + return wedpr_java_transportJNI.GrpcConfig_maxMsgSize(swigCPtr, this); + } + + public void setMaxMsgSize(java.math.BigInteger maxMsgSize) { + wedpr_java_transportJNI.GrpcConfig_setMaxMsgSize(swigCPtr, this, maxMsgSize); + } } diff --git a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcServerConfig.java b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcServerConfig.java index 179abdc3..3f138170 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcServerConfig.java +++ b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/GrpcServerConfig.java @@ -33,16 +33,12 @@ protected static long swigRelease(GrpcServerConfig obj) { return ptr; } - @SuppressWarnings({"deprecation", "removal"}) - protected void finalize() { - delete(); - } - public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; - wedpr_java_transportJNI.delete_GrpcServerConfig(swigCPtr); + throw new UnsupportedOperationException( + "C++ destructor does not have public access"); } swigCPtr = 0; } @@ -86,4 +82,9 @@ public EndPoint mutableEndPoint() { public boolean enableHealthCheck() { return wedpr_java_transportJNI.GrpcServerConfig_enableHealthCheck(swigCPtr, this); } + + public GrpcConfig grpcConfig() { + long cPtr = wedpr_java_transportJNI.GrpcServerConfig_grpcConfig(swigCPtr, this); + return (cPtr == 0) ? null : new GrpcConfig(cPtr, true); + } } diff --git a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java index dc50506c..ab64b268 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java +++ b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/Message.java @@ -100,11 +100,6 @@ public byte[] payloadBuffer() { return wedpr_java_transportJNI.Message_payloadBuffer(swigCPtr, this); } - public void setFrontMessage(MessagePayload frontMessage) { - wedpr_java_transportJNI.Message_setFrontMessage( - swigCPtr, this, MessagePayload.getCPtr(frontMessage), frontMessage); - } - public MessagePayload frontMessage() { long cPtr = wedpr_java_transportJNI.Message_frontMessage(swigCPtr, this); return (cPtr == 0) ? null : new MessagePayload(cPtr, true); @@ -129,6 +124,10 @@ public ubytes payload() { return (cPtr == 0) ? null : new ubytes(cPtr, true); } + public void releasePayload() { + wedpr_java_transportJNI.Message_releasePayload(swigCPtr, this); + } + public void disOwnMemory() { swigSetCMemOwn(false); } diff --git a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/MessagePayload.java b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/MessagePayload.java index 3998cdba..c83bc33d 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/MessagePayload.java +++ b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/MessagePayload.java @@ -98,6 +98,10 @@ public boolean isRespPacket() { return wedpr_java_transportJNI.MessagePayload_isRespPacket(swigCPtr, this); } + public void releasePayload() { + wedpr_java_transportJNI.MessagePayload_releasePayload(swigCPtr, this); + } + public void disOwnMemory() { swigSetCMemOwn(false); } diff --git a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java index f5fedd8f..6899432c 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java +++ b/cpp/wedpr-transport/sdk-wrapper/java/bindings/src/main/java/com/webank/wedpr/sdk/jni/generated/wedpr_java_transportJNI.java @@ -361,34 +361,8 @@ public static final native long FrontConfigBuilder_build__SWIG_1( public static final native String EndPoint_listenIp(long jarg1, EndPoint jarg1_); - public static final native long new_GrpcServerConfig__SWIG_0(); - - public static final native long new_GrpcServerConfig__SWIG_1( - long jarg1, EndPoint jarg1_, boolean jarg2); - - public static final native String GrpcServerConfig_listenEndPoint( - long jarg1, GrpcServerConfig jarg1_); - - public static final native void GrpcServerConfig_setEndPoint( - long jarg1, GrpcServerConfig jarg1_, long jarg2, EndPoint jarg2_); - - public static final native void GrpcServerConfig_setEnableHealthCheck( - long jarg1, GrpcServerConfig jarg1_, boolean jarg2); - - public static final native long GrpcServerConfig_endPoint(long jarg1, GrpcServerConfig jarg1_); - - public static final native long GrpcServerConfig_mutableEndPoint( - long jarg1, GrpcServerConfig jarg1_); - - public static final native boolean GrpcServerConfig_enableHealthCheck( - long jarg1, GrpcServerConfig jarg1_); - - public static final native void delete_GrpcServerConfig(long jarg1); - public static final native long new_GrpcConfig(); - public static final native void delete_GrpcConfig(long jarg1); - public static final native String GrpcConfig_loadBalancePolicy(long jarg1, GrpcConfig jarg1_); public static final native void GrpcConfig_setLoadBalancePolicy( @@ -421,6 +395,37 @@ public static final native void GrpcConfig_setMaxReceivedMessageSize( public static final native void GrpcConfig_setCompressAlgorithm( long jarg1, GrpcConfig jarg1_, int jarg2); + public static final native java.math.BigInteger GrpcConfig_maxMsgSize( + long jarg1, GrpcConfig jarg1_); + + public static final native void GrpcConfig_setMaxMsgSize( + long jarg1, GrpcConfig jarg1_, java.math.BigInteger jarg2); + + public static final native long new_GrpcServerConfig__SWIG_0(); + + public static final native long new_GrpcServerConfig__SWIG_1( + long jarg1, EndPoint jarg1_, boolean jarg2); + + public static final native String GrpcServerConfig_listenEndPoint( + long jarg1, GrpcServerConfig jarg1_); + + public static final native void GrpcServerConfig_setEndPoint( + long jarg1, GrpcServerConfig jarg1_, long jarg2, EndPoint jarg2_); + + public static final native void GrpcServerConfig_setEnableHealthCheck( + long jarg1, GrpcServerConfig jarg1_, boolean jarg2); + + public static final native long GrpcServerConfig_endPoint(long jarg1, GrpcServerConfig jarg1_); + + public static final native long GrpcServerConfig_mutableEndPoint( + long jarg1, GrpcServerConfig jarg1_); + + public static final native boolean GrpcServerConfig_enableHealthCheck( + long jarg1, GrpcServerConfig jarg1_); + + public static final native long GrpcServerConfig_grpcConfig( + long jarg1, GrpcServerConfig jarg1_); + public static final native String printGrpcConfig(long jarg1, GrpcConfig jarg1_); public static final native void delete_MessageOptionalHeader(long jarg1); @@ -570,9 +575,6 @@ public static final native void Message_setPayload( public static final native byte[] Message_payloadBuffer(long jarg1, Message jarg1_); - public static final native void Message_setFrontMessage( - long jarg1, Message jarg1_, long jarg2, MessagePayload jarg2_); - public static final native long Message_frontMessage(long jarg1, Message jarg1_); public static final native boolean Message_encode( @@ -584,6 +586,8 @@ public static final native boolean Message_encode( public static final native long Message_payload(long jarg1, Message jarg1_); + public static final native void Message_releasePayload(long jarg1, Message jarg1_); + public static final native void delete_MessageHeaderBuilder(long jarg1); public static final native long MessageHeaderBuilder_build__SWIG_0( @@ -665,6 +669,9 @@ public static final native void MessagePayload_setExt( public static final native boolean MessagePayload_isRespPacket( long jarg1, MessagePayload jarg1_); + public static final native void MessagePayload_releasePayload( + long jarg1, MessagePayload jarg1_); + public static final native void delete_MessagePayloadBuilder(long jarg1); public static final native long MessagePayloadBuilder_build__SWIG_0( diff --git a/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx b/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx index fec5698c..f839dee8 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx +++ b/cpp/wedpr-transport/sdk-wrapper/java/src/wedpr_java_transportJAVA_wrap.cxx @@ -4914,116 +4914,123 @@ SWIGEXPORT jstring JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1 } -SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_new_1GrpcServerConfig_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { +SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_new_1GrpcConfig(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; - ppc::protocol::GrpcServerConfig *result = 0 ; + ppc::protocol::GrpcConfig *result = 0 ; (void)jenv; (void)jcls; { try { - result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(); + result = (ppc::protocol::GrpcConfig *)new ppc::protocol::GrpcConfig(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - *(ppc::protocol::GrpcServerConfig **)&jresult = result; + + *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jresult = result ? new std::shared_ptr< ppc::protocol::GrpcConfig >(result SWIG_NO_NULL_DELETER_1) : 0; + return jresult; } -SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_new_1GrpcServerConfig_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jlong jresult = 0 ; - ppc::protocol::EndPoint arg1 ; - bool arg2 ; - ppc::protocol::EndPoint *argp1 ; - ppc::protocol::GrpcServerConfig *result = 0 ; +SWIGEXPORT jstring JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1loadBalancePolicy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; + std::string *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - argp1 = *(ppc::protocol::EndPoint **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null ppc::protocol::EndPoint"); - return 0; - } - arg1 = *argp1; - arg2 = jarg2 ? true : false; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(arg1,arg2); + result = (std::string *) &((ppc::protocol::GrpcConfig const *)arg1)->loadBalancePolicy(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - *(ppc::protocol::GrpcServerConfig **)&jresult = result; + jresult = jenv->NewStringUTF(result->c_str()); return jresult; } -SWIGEXPORT jstring JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1listenEndPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; - std::string result; +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setLoadBalancePolicy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + std::string *arg2 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + + smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + if(!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); + return ; + } + const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2_pstr) return ; + std::string arg2_str(arg2_pstr); + arg2 = &arg2_str; + jenv->ReleaseStringUTFChars(jarg2, arg2_pstr); { try { - result = ((ppc::protocol::GrpcServerConfig const *)arg1)->listenEndPoint(); + (arg1)->setLoadBalancePolicy((std::string const &)*arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return 0; + return ; } } - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1setEndPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; - ppc::protocol::EndPoint arg2 ; - ppc::protocol::EndPoint *argp2 ; +SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1enableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; + bool result; (void)jenv; (void)jcls; (void)jarg1_; - (void)jarg2_; - arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; - argp2 = *(ppc::protocol::EndPoint **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null ppc::protocol::EndPoint"); - return ; - } - arg2 = *argp2; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - (arg1)->setEndPoint(arg2); + result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableHealthCheck(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return ; + return 0; } } + jresult = (jboolean)result; + return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1setEnableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setEnableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; bool arg2 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + + smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); arg2 = jarg2 ? true : false; { try { @@ -5037,127 +5044,231 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra } -SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1endPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; - ppc::protocol::EndPoint *result = 0 ; +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setEnableDnslookup(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + bool arg2 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + + smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + arg2 = jarg2 ? true : false; { try { - result = (ppc::protocol::EndPoint *) &((ppc::protocol::GrpcServerConfig const *)arg1)->endPoint(); + (arg1)->setEnableDnslookup(arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return 0; + return ; } } - *(ppc::protocol::EndPoint **)&jresult = result; - return jresult; } -SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1mutableEndPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; - ppc::protocol::EndPoint *result = 0 ; +SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1enableDnslookup(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; + bool result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - result = (ppc::protocol::EndPoint *) &(arg1)->mutableEndPoint(); + result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableDnslookup(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - *(ppc::protocol::EndPoint **)&jresult = result; + jresult = (jboolean)result; return jresult; } -SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1enableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; - bool result; +SWIGEXPORT jobject JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1maxSendMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jobject jresult = 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; + uint64_t result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - result = (bool)((ppc::protocol::GrpcServerConfig const *)arg1)->enableHealthCheck(); + result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxSendMessageSize(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - jresult = (jboolean)result; + { + jbyteArray ba = jenv->NewByteArray(9); + jbyte* bae = jenv->GetByteArrayElements(ba, 0); + jclass clazz = jenv->FindClass("java/math/BigInteger"); + jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); + jobject bigint; + int i; + + bae[0] = 0; + for(i=1; i<9; i++ ) { + bae[i] = (jbyte)(result>>8*(8-i)); + } + + jenv->ReleaseByteArrayElements(ba, bae, 0); + bigint = jenv->NewObject(clazz, mid, ba); + jenv->DeleteLocalRef(ba); + jresult = bigint; + } return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_delete_1GrpcServerConfig(JNIEnv *jenv, jclass jcls, jlong jarg1) { - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; +SWIGEXPORT jobject JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1maxReceivedMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jobject jresult = 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; + uint64_t result; (void)jenv; (void)jcls; - arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - delete arg1; + result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxReceivedMessageSize(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return ; + return 0; } } + { + jbyteArray ba = jenv->NewByteArray(9); + jbyte* bae = jenv->GetByteArrayElements(ba, 0); + jclass clazz = jenv->FindClass("java/math/BigInteger"); + jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); + jobject bigint; + int i; + + bae[0] = 0; + for(i=1; i<9; i++ ) { + bae[i] = (jbyte)(result>>8*(8-i)); + } + + jenv->ReleaseByteArrayElements(ba, bae, 0); + bigint = jenv->NewObject(clazz, mid, ba); + jenv->DeleteLocalRef(ba); + jresult = bigint; + } + return jresult; } -SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_new_1GrpcConfig(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - ppc::protocol::GrpcConfig *result = 0 ; +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setMaxSendMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + uint64_t arg2 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; (void)jenv; (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; + arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return ; + } + clazz = jenv->GetObjectClass(jarg2); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg2 = 0; + if (sz > 0) { + arg2 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } { try { - result = (ppc::protocol::GrpcConfig *)new ppc::protocol::GrpcConfig(); + (arg1)->setMaxSendMessageSize(arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return 0; + return ; } } - - *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jresult = result ? new std::shared_ptr< ppc::protocol::GrpcConfig >(result SWIG_NO_NULL_DELETER_1) : 0; - - return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_delete_1GrpcConfig(JNIEnv *jenv, jclass jcls, jlong jarg1) { +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setMaxReceivedMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + uint64_t arg2 ; std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; (void)jenv; (void)jcls; + (void)jarg1_; smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + { + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); + return ; + } + clazz = jenv->GetObjectClass(jarg2); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg2 = 0; + if (sz > 0) { + arg2 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); + } { try { - (void)arg1; delete smartarg1; + (arg1)->setMaxReceivedMessageSize(arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); @@ -5167,11 +5278,11 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra } -SWIGEXPORT jstring JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1loadBalancePolicy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; +SWIGEXPORT jint JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1compressAlgorithm(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jint jresult = 0 ; ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - std::string *result = 0 ; + int result; (void)jenv; (void)jcls; @@ -5181,21 +5292,21 @@ SWIGEXPORT jstring JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1 arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - result = (std::string *) &((ppc::protocol::GrpcConfig const *)arg1)->loadBalancePolicy(); + result = (int)((ppc::protocol::GrpcConfig const *)arg1)->compressAlgorithm(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - jresult = jenv->NewStringUTF(result->c_str()); + jresult = (jint)result; return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setLoadBalancePolicy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setCompressAlgorithm(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - std::string *arg2 = 0 ; + int arg2 ; std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; (void)jenv; @@ -5204,18 +5315,10 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); - if(!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string"); - return ; - } - const char *arg2_pstr = (const char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2_pstr) return ; - std::string arg2_str(arg2_pstr); - arg2 = &arg2_str; - jenv->ReleaseStringUTFChars(jarg2, arg2_pstr); + arg2 = (int)jarg2; { try { - (arg1)->setLoadBalancePolicy((std::string const &)*arg2); + (arg1)->setCompressAlgorithm(arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); @@ -5225,11 +5328,11 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra } -SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1enableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; +SWIGEXPORT jobject JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1maxMsgSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jobject jresult = 0 ; ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - bool result; + uint64_t result; (void)jenv; (void)jcls; @@ -5239,21 +5342,38 @@ SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_ arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableHealthCheck(); + result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxMsgSize(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - jresult = (jboolean)result; + { + jbyteArray ba = jenv->NewByteArray(9); + jbyte* bae = jenv->GetByteArrayElements(ba, 0); + jclass clazz = jenv->FindClass("java/math/BigInteger"); + jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); + jobject bigint; + int i; + + bae[0] = 0; + for(i=1; i<9; i++ ) { + bae[i] = (jbyte)(result>>8*(8-i)); + } + + jenv->ReleaseByteArrayElements(ba, bae, 0); + bigint = jenv->NewObject(clazz, mid, ba); + jenv->DeleteLocalRef(ba); + jresult = bigint; + } return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setEnableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setMaxMsgSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - bool arg2 ; + uint64_t arg2 ; std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; (void)jenv; @@ -5262,34 +5382,35 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); - arg2 = jarg2 ? true : false; { - try { - (arg1)->setEnableHealthCheck(arg2); - } - catch (const std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); + jclass clazz; + jmethodID mid; + jbyteArray ba; + jbyte* bae; + jsize sz; + int i; + + if (!jarg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); return ; } + clazz = jenv->GetObjectClass(jarg2); + mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); + ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); + bae = jenv->GetByteArrayElements(ba, 0); + sz = jenv->GetArrayLength(ba); + arg2 = 0; + if (sz > 0) { + arg2 = (uint64_t)(signed char)bae[0]; + for(i=1; iReleaseByteArrayElements(ba, bae, 0); } -} - - -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setEnableDnslookup(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - bool arg2 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - - smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); - arg2 = jarg2 ? true : false; { try { - (arg1)->setEnableDnslookup(arg2); + (arg1)->setMaxMsgSize(arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); @@ -5299,158 +5420,120 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra } -SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1enableDnslookup(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - bool result; +SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_new_1GrpcServerConfig_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + ppc::protocol::GrpcServerConfig *result = 0 ; (void)jenv; (void)jcls; - (void)jarg1_; - - smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); { try { - result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableDnslookup(); + result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - jresult = (jboolean)result; + *(ppc::protocol::GrpcServerConfig **)&jresult = result; return jresult; } -SWIGEXPORT jobject JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1maxSendMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - uint64_t result; +SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_new_1GrpcServerConfig_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { + jlong jresult = 0 ; + ppc::protocol::EndPoint arg1 ; + bool arg2 ; + ppc::protocol::EndPoint *argp1 ; + ppc::protocol::GrpcServerConfig *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - - smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + argp1 = *(ppc::protocol::EndPoint **)&jarg1; + if (!argp1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null ppc::protocol::EndPoint"); + return 0; + } + arg1 = *argp1; + arg2 = jarg2 ? true : false; { try { - result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxSendMessageSize(); + result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(arg1,arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return 0; - } - } - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); + return 0; } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; } + *(ppc::protocol::GrpcServerConfig **)&jresult = result; return jresult; } -SWIGEXPORT jobject JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1maxReceivedMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - uint64_t result; +SWIGEXPORT jstring JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1listenEndPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jstring jresult = 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + std::string result; (void)jenv; (void)jcls; (void)jarg1_; - - smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; { try { - result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxReceivedMessageSize(); + result = ((ppc::protocol::GrpcServerConfig const *)arg1)->listenEndPoint(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } + jresult = jenv->NewStringUTF((&result)->c_str()); return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setMaxSendMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - uint64_t arg2 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1setEndPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::EndPoint arg2 ; + ppc::protocol::EndPoint *argp2 ; (void)jenv; (void)jcls; (void)jarg1_; - - smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + (void)jarg2_; + arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + argp2 = *(ppc::protocol::EndPoint **)&jarg2; + if (!argp2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null ppc::protocol::EndPoint"); + return ; + } + arg2 = *argp2; { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; + try { + (arg1)->setEndPoint(arg2); } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); } +} + + +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1setEnableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + bool arg2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; + arg2 = jarg2 ? true : false; { try { - (arg1)->setMaxSendMessageSize(arg2); + (arg1)->setEnableHealthCheck(arg2); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); @@ -5460,102 +5543,95 @@ SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tra } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setMaxReceivedMessageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - uint64_t arg2 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; +SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1endPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::EndPoint *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - - smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; + try { + result = (ppc::protocol::EndPoint *) &((ppc::protocol::GrpcServerConfig const *)arg1)->endPoint(); } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); } + *(ppc::protocol::EndPoint **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1mutableEndPoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::EndPoint *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; { try { - (arg1)->setMaxReceivedMessageSize(arg2); + result = (ppc::protocol::EndPoint *) &(arg1)->mutableEndPoint(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return ; + return 0; } } + *(ppc::protocol::EndPoint **)&jresult = result; + return jresult; } -SWIGEXPORT jint JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1compressAlgorithm(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - int result; +SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1enableHealthCheck(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jboolean jresult = 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + bool result; (void)jenv; (void)jcls; (void)jarg1_; - - smartarg1 = *(std::shared_ptr< const ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); + arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; { try { - result = (int)((ppc::protocol::GrpcConfig const *)arg1)->compressAlgorithm(); + result = (bool)((ppc::protocol::GrpcServerConfig const *)arg1)->enableHealthCheck(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); return 0; } } - jresult = (jint)result; + jresult = (jboolean)result; return jresult; } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcConfig_1setCompressAlgorithm(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - int arg2 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; +SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_GrpcServerConfig_1grpcConfig(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::GrpcConfig::Ptr *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; - - smartarg1 = *(std::shared_ptr< ppc::protocol::GrpcConfig > **)&jarg1; - arg1 = (ppc::protocol::GrpcConfig *)(smartarg1 ? smartarg1->get() : 0); - arg2 = (int)jarg2; + arg1 = *(ppc::protocol::GrpcServerConfig **)&jarg1; { try { - (arg1)->setCompressAlgorithm(arg2); + result = (ppc::protocol::GrpcConfig::Ptr *) &((ppc::protocol::GrpcServerConfig const *)arg1)->grpcConfig(); } catch (const std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return ; + return 0; } } + *(ppc::protocol::GrpcConfig::Ptr **)&jresult = *result ? new ppc::protocol::GrpcConfig::Ptr(*result) : 0; + return jresult; } @@ -7232,33 +7308,6 @@ SWIGEXPORT jbyteArray JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1jav } -SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1setFrontMessage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; - ppc::protocol::MessagePayload::Ptr arg2 ; - std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; - ppc::protocol::MessagePayload::Ptr *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - - smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; - arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); - argp2 = *(ppc::protocol::MessagePayload::Ptr **)&jarg2; - if (argp2) arg2 = *argp2; - { - try { - (arg1)->setFrontMessage(arg2); - } - catch (const std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); - return ; - } - } -} - - SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1frontMessage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; @@ -7405,6 +7454,28 @@ SWIGEXPORT jlong JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1tr } +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_Message_1releasePayload(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::Message > **)&jarg1; + arg1 = (ppc::protocol::Message *)(smartarg1 ? smartarg1->get() : 0); + { + try { + (arg1)->releasePayload(); + } + catch (const std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); + return ; + } + } +} + + SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_delete_1MessageHeaderBuilder(JNIEnv *jenv, jclass jcls, jlong jarg1) { ppc::protocol::MessageHeaderBuilder *arg1 = (ppc::protocol::MessageHeaderBuilder *) 0 ; std::shared_ptr< ppc::protocol::MessageHeaderBuilder > *smartarg1 = 0 ; @@ -8190,6 +8261,28 @@ SWIGEXPORT jboolean JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_ } +SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_MessagePayload_1releasePayload(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + ppc::protocol::MessagePayload *arg1 = (ppc::protocol::MessagePayload *) 0 ; + std::shared_ptr< ppc::protocol::MessagePayload > *smartarg1 = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + + smartarg1 = *(std::shared_ptr< ppc::protocol::MessagePayload > **)&jarg1; + arg1 = (ppc::protocol::MessagePayload *)(smartarg1 ? smartarg1->get() : 0); + { + try { + (arg1)->releasePayload(); + } + catch (const std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, std::string(boost::diagnostic_information(e)).c_str()); + return ; + } + } +} + + SWIGEXPORT void JNICALL Java_com_webank_wedpr_sdk_jni_generated_wedpr_1java_1transportJNI_delete_1MessagePayloadBuilder(JNIEnv *jenv, jclass jcls, jlong jarg1) { ppc::protocol::MessagePayloadBuilder *arg1 = (ppc::protocol::MessagePayloadBuilder *) 0 ; std::shared_ptr< ppc::protocol::MessagePayloadBuilder > *smartarg1 = 0 ; diff --git a/cpp/wedpr-transport/sdk-wrapper/java/swig/wedpr_java_transport.i b/cpp/wedpr-transport/sdk-wrapper/java/swig/wedpr_java_transport.i index 9e32fe66..879134e6 100644 --- a/cpp/wedpr-transport/sdk-wrapper/java/swig/wedpr_java_transport.i +++ b/cpp/wedpr-transport/sdk-wrapper/java/swig/wedpr_java_transport.i @@ -253,6 +253,9 @@ WRAP(ppc::sdk::Transport) %ignore ppc::protocol::INodeInfo::toJson; %ignore ppc::protocol::INodeInfo::setComponents; %ignore ppc::protocol::INodeInfoFactory; +%ignore ppc::protocol::Message::setFrontMessage; +%ignore ppc::protocol::GrpcConfig::~GrpcConfig; +%ignore ppc::protocol::GrpcServerConfig::~GrpcServerConfig; %include "exception.i" %exception { diff --git a/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py b/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py index 62ab6aca..17190df1 100644 --- a/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py +++ b/cpp/wedpr-transport/sdk-wrapper/python/bindings/wedpr_python_gateway_sdk/transport/generated/wedpr_python_transport.py @@ -1075,39 +1075,6 @@ def listenIp(self): _wedpr_python_transport.EndPoint_swigregister(EndPoint) -class GrpcServerConfig(object): - thisown = property(lambda x: x.this.own(), lambda x, - v: x.this.own(v), doc="The membership flag") - __repr__ = _swig_repr - - def __init__(self, *args): - _wedpr_python_transport.GrpcServerConfig_swiginit( - self, _wedpr_python_transport.new_GrpcServerConfig(*args)) - - def listenEndPoint(self): - return _wedpr_python_transport.GrpcServerConfig_listenEndPoint(self) - - def setEndPoint(self, endPoint): - return _wedpr_python_transport.GrpcServerConfig_setEndPoint(self, endPoint) - - def setEnableHealthCheck(self, enableHealthCheck): - return _wedpr_python_transport.GrpcServerConfig_setEnableHealthCheck(self, enableHealthCheck) - - def endPoint(self): - return _wedpr_python_transport.GrpcServerConfig_endPoint(self) - - def mutableEndPoint(self): - return _wedpr_python_transport.GrpcServerConfig_mutableEndPoint(self) - - def enableHealthCheck(self): - return _wedpr_python_transport.GrpcServerConfig_enableHealthCheck(self) - __swig_destroy__ = _wedpr_python_transport.delete_GrpcServerConfig - - -# Register GrpcServerConfig in _wedpr_python_transport: -_wedpr_python_transport.GrpcServerConfig_swigregister(GrpcServerConfig) - - class GrpcConfig(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -1116,7 +1083,6 @@ class GrpcConfig(object): def __init__(self): _wedpr_python_transport.GrpcConfig_swiginit( self, _wedpr_python_transport.new_GrpcConfig()) - __swig_destroy__ = _wedpr_python_transport.delete_GrpcConfig def loadBalancePolicy(self): return _wedpr_python_transport.GrpcConfig_loadBalancePolicy(self) @@ -1154,11 +1120,52 @@ def compressAlgorithm(self): def setCompressAlgorithm(self, compressAlgorithm): return _wedpr_python_transport.GrpcConfig_setCompressAlgorithm(self, compressAlgorithm) + def maxMsgSize(self): + return _wedpr_python_transport.GrpcConfig_maxMsgSize(self) + + def setMaxMsgSize(self, maxMsgSize): + return _wedpr_python_transport.GrpcConfig_setMaxMsgSize(self, maxMsgSize) + # Register GrpcConfig in _wedpr_python_transport: _wedpr_python_transport.GrpcConfig_swigregister(GrpcConfig) +class GrpcServerConfig(object): + thisown = property(lambda x: x.this.own(), lambda x, + v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _wedpr_python_transport.GrpcServerConfig_swiginit( + self, _wedpr_python_transport.new_GrpcServerConfig(*args)) + + def listenEndPoint(self): + return _wedpr_python_transport.GrpcServerConfig_listenEndPoint(self) + + def setEndPoint(self, endPoint): + return _wedpr_python_transport.GrpcServerConfig_setEndPoint(self, endPoint) + + def setEnableHealthCheck(self, enableHealthCheck): + return _wedpr_python_transport.GrpcServerConfig_setEnableHealthCheck(self, enableHealthCheck) + + def endPoint(self): + return _wedpr_python_transport.GrpcServerConfig_endPoint(self) + + def mutableEndPoint(self): + return _wedpr_python_transport.GrpcServerConfig_mutableEndPoint(self) + + def enableHealthCheck(self): + return _wedpr_python_transport.GrpcServerConfig_enableHealthCheck(self) + + def grpcConfig(self): + return _wedpr_python_transport.GrpcServerConfig_grpcConfig(self) + + +# Register GrpcServerConfig in _wedpr_python_transport: +_wedpr_python_transport.GrpcServerConfig_swigregister(GrpcServerConfig) + + def printGrpcConfig(grpcConfig): return _wedpr_python_transport.printGrpcConfig(grpcConfig) @@ -1365,9 +1372,6 @@ def setPayload(self, _payload): def payloadBuffer(self): return _wedpr_python_transport.Message_payloadBuffer(self) - def setFrontMessage(self, frontMessage): - return _wedpr_python_transport.Message_setFrontMessage(self, frontMessage) - def frontMessage(self): return _wedpr_python_transport.Message_frontMessage(self) @@ -1383,6 +1387,9 @@ def length(self): def payload(self): return _wedpr_python_transport.Message_payload(self) + def releasePayload(self): + return _wedpr_python_transport.Message_releasePayload(self) + # Register Message in _wedpr_python_transport: _wedpr_python_transport.Message_swigregister(Message) @@ -1502,6 +1509,9 @@ def setRespPacket(self): def isRespPacket(self): return _wedpr_python_transport.MessagePayload_isRespPacket(self) + def releasePayload(self): + return _wedpr_python_transport.MessagePayload_releasePayload(self) + # Register MessagePayload in _wedpr_python_transport: _wedpr_python_transport.MessagePayload_swigregister(MessagePayload) diff --git a/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx b/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx index abe25249..f5b2674f 100644 --- a/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx +++ b/cpp/wedpr-transport/sdk-wrapper/python/src/wedpr_python_transportPYTHON_wrap.cxx @@ -19016,171 +19016,209 @@ SWIGINTERN PyObject *EndPoint_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_GrpcServerConfig__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { +SWIGINTERN PyObject *_wrap_new_GrpcConfig(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *result = 0 ; + ppc::protocol::GrpcConfig *result = 0 ; (void)self; - if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_GrpcConfig", 0, 0, 0)) SWIG_fail; { try { - result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(); + result = (ppc::protocol::GrpcConfig *)new ppc::protocol::GrpcConfig(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__GrpcServerConfig, SWIG_POINTER_NEW | 0 ); + { + std::shared_ptr< ppc::protocol::GrpcConfig > *smartresult = result ? new std::shared_ptr< ppc::protocol::GrpcConfig >(result SWIG_NO_NULL_DELETER_SWIG_POINTER_NEW) : 0; + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(smartresult), SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, SWIG_POINTER_NEW | SWIG_POINTER_OWN); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_GrpcServerConfig__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_GrpcConfig_loadBalancePolicy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::EndPoint arg1 ; - bool arg2 ; - void *argp1 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + void *argp1 = 0 ; int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - ppc::protocol::GrpcServerConfig *result = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + std::string *result = 0 ; (void)self; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; { - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0); + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GrpcServerConfig" "', argument " "1"" of type '" "ppc::protocol::EndPoint""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GrpcServerConfig" "', argument " "1"" of type '" "ppc::protocol::EndPoint""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_loadBalancePolicy" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); } else { - ppc::protocol::EndPoint * temp = reinterpret_cast< ppc::protocol::EndPoint * >(argp1); - arg1 = *temp; - if (SWIG_IsNewObj(res1)) delete temp; + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); } } - ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GrpcServerConfig" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); { try { - result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(arg1,arg2); + result = (std::string *) &((ppc::protocol::GrpcConfig const *)arg1)->loadBalancePolicy(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__GrpcServerConfig, SWIG_POINTER_NEW | 0 ); + resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_new_GrpcServerConfig(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[3] = { - 0 - }; +SWIGINTERN PyObject *_wrap_GrpcConfig_setLoadBalancePolicy(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; + int res2 = SWIG_OLDOBJ ; + PyObject *swig_obj[2] ; - if (!(argc = SWIG_Python_UnpackTuple(args, "new_GrpcServerConfig", 0, 2, argv))) SWIG_fail; - --argc; - if (argc == 0) { - return _wrap_new_GrpcServerConfig__SWIG_0(self, argc, argv); + (void)self; + if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setLoadBalancePolicy", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setLoadBalancePolicy" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + } } - if (argc == 2) { - int _v = 0; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_ppc__protocol__EndPoint, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_bool(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_GrpcServerConfig__SWIG_1(self, argc, argv); - } + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GrpcConfig_setLoadBalancePolicy" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GrpcConfig_setLoadBalancePolicy" "', argument " "2"" of type '" "std::string const &""'"); } + arg2 = ptr; } - + { + try { + (arg1)->setLoadBalancePolicy((std::string const &)*arg2); + } + catch (const std::exception& e) { + SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); + } + } + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res2)) delete arg2; + return resultobj; fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_GrpcServerConfig'.\n" - " Possible C/C++ prototypes are:\n" - " ppc::protocol::GrpcServerConfig::GrpcServerConfig()\n" - " ppc::protocol::GrpcServerConfig::GrpcServerConfig(ppc::protocol::EndPoint,bool)\n"); - return 0; + if (SWIG_IsNewObj(res2)) delete arg2; + return NULL; } -SWIGINTERN PyObject *_wrap_GrpcServerConfig_listenEndPoint(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_enableHealthCheck(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; - std::string result; + bool result; (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_listenEndPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig const *""'"); + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_enableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + } } - arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - result = ((ppc::protocol::GrpcServerConfig const *)arg1)->listenEndPoint(); + result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableHealthCheck(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); + resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcServerConfig_setEndPoint(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_setEnableHealthCheck(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; - ppc::protocol::EndPoint arg2 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + bool arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; + bool val2 ; + int ecode2 = 0 ; PyObject *swig_obj[2] ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcServerConfig_setEndPoint", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_setEndPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig *""'"); - } - arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); + if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setEnableHealthCheck", 2, 2, swig_obj)) SWIG_fail; { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GrpcServerConfig_setEndPoint" "', argument " "2"" of type '" "ppc::protocol::EndPoint""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GrpcServerConfig_setEndPoint" "', argument " "2"" of type '" "ppc::protocol::EndPoint""'"); + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setEnableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); } else { - ppc::protocol::EndPoint * temp = reinterpret_cast< ppc::protocol::EndPoint * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); } } + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setEnableHealthCheck" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); { try { - (arg1)->setEndPoint(arg2); + (arg1)->setEnableHealthCheck(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); @@ -19193,31 +19231,43 @@ SWIGINTERN PyObject *_wrap_GrpcServerConfig_setEndPoint(PyObject *self, PyObject } -SWIGINTERN PyObject *_wrap_GrpcServerConfig_setEnableHealthCheck(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_setEnableDnslookup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; bool arg2 ; void *argp1 = 0 ; int res1 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; bool val2 ; int ecode2 = 0 ; PyObject *swig_obj[2] ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcServerConfig_setEnableHealthCheck", 2, 2, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_setEnableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig *""'"); + if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setEnableDnslookup", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setEnableDnslookup" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + } } - arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcServerConfig_setEnableHealthCheck" "', argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setEnableDnslookup" "', argument " "2"" of type '" "bool""'"); } arg2 = static_cast< bool >(val2); { try { - (arg1)->setEnableHealthCheck(arg2); + (arg1)->setEnableDnslookup(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); @@ -19230,181 +19280,203 @@ SWIGINTERN PyObject *_wrap_GrpcServerConfig_setEnableHealthCheck(PyObject *self, } -SWIGINTERN PyObject *_wrap_GrpcServerConfig_endPoint(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_enableDnslookup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; - ppc::protocol::EndPoint *result = 0 ; + bool result; (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_endPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig const *""'"); - } - arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { - try { - result = (ppc::protocol::EndPoint *) &((ppc::protocol::GrpcServerConfig const *)arg1)->endPoint(); - } - catch (const std::exception& e) { - SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_enableDnslookup" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_GrpcServerConfig_mutableEndPoint(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - ppc::protocol::EndPoint *result = 0 ; - - (void)self; - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_mutableEndPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig *""'"); - } - arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - result = (ppc::protocol::EndPoint *) &(arg1)->mutableEndPoint(); + result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableDnslookup(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0 ); + resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcServerConfig_enableHealthCheck(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_maxSendMessageSize(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; - bool result; + uint64_t result; (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_enableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig const *""'"); + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_maxSendMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + } } - arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - result = (bool)((ppc::protocol::GrpcServerConfig const *)arg1)->enableHealthCheck(); + result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxSendMessageSize(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_bool(static_cast< bool >(result)); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_delete_GrpcServerConfig(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_maxReceivedMessageSize(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; + uint64_t result; (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GrpcServerConfig" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig *""'"); + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_maxReceivedMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + } } - arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - delete arg1; + result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxReceivedMessageSize(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *GrpcServerConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ppc__protocol__GrpcServerConfig, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *GrpcServerConfig_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - return SWIG_Python_InitShadowInstance(args); -} - -SWIGINTERN PyObject *_wrap_new_GrpcConfig(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_setMaxSendMessageSize(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *result = 0 ; + ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + uint64_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; + std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; + unsigned long long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "new_GrpcConfig", 0, 0, 0)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setMaxSendMessageSize", 2, 2, swig_obj)) SWIG_fail; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setMaxSendMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); + arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + } + } + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setMaxSendMessageSize" "', argument " "2"" of type '" "uint64_t""'"); + } + arg2 = static_cast< uint64_t >(val2); { try { - result = (ppc::protocol::GrpcConfig *)new ppc::protocol::GrpcConfig(); + (arg1)->setMaxSendMessageSize(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - { - std::shared_ptr< ppc::protocol::GrpcConfig > *smartresult = result ? new std::shared_ptr< ppc::protocol::GrpcConfig >(result SWIG_NO_NULL_DELETER_SWIG_POINTER_NEW) : 0; - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(smartresult), SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, SWIG_POINTER_NEW | SWIG_POINTER_OWN); - } + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_delete_GrpcConfig(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_setMaxReceivedMessageSize(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + uint64_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; - PyObject *swig_obj[1] ; + unsigned long long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; (void)self; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setMaxReceivedMessageSize", 2, 2, swig_obj)) SWIG_fail; { int newmem = 0; res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GrpcConfig" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setMaxReceivedMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); @@ -19415,9 +19487,14 @@ SWIGINTERN PyObject *_wrap_delete_GrpcConfig(PyObject *self, PyObject *args) { arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); } } + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setMaxReceivedMessageSize" "', argument " "2"" of type '" "uint64_t""'"); + } + arg2 = static_cast< uint64_t >(val2); { try { - (void)arg1; delete smartarg1; + (arg1)->setMaxReceivedMessageSize(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); @@ -19430,7 +19507,7 @@ SWIGINTERN PyObject *_wrap_delete_GrpcConfig(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_GrpcConfig_loadBalancePolicy(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_compressAlgorithm(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; void *argp1 = 0 ; @@ -19438,7 +19515,7 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_loadBalancePolicy(PyObject *self, PyObject std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; - std::string *result = 0 ; + int result; (void)self; if (!args) SWIG_fail; @@ -19447,7 +19524,7 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_loadBalancePolicy(PyObject *self, PyObject int newmem = 0; res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_loadBalancePolicy" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_compressAlgorithm" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); @@ -19460,37 +19537,38 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_loadBalancePolicy(PyObject *self, PyObject } { try { - result = (std::string *) &((ppc::protocol::GrpcConfig const *)arg1)->loadBalancePolicy(); + result = (int)((ppc::protocol::GrpcConfig const *)arg1)->compressAlgorithm(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); + resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_setLoadBalancePolicy(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_setCompressAlgorithm(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - std::string *arg2 = 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; - int res2 = SWIG_OLDOBJ ; + int val2 ; + int ecode2 = 0 ; PyObject *swig_obj[2] ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setLoadBalancePolicy", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setCompressAlgorithm", 2, 2, swig_obj)) SWIG_fail; { int newmem = 0; res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setLoadBalancePolicy" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setCompressAlgorithm" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); @@ -19501,35 +19579,27 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_setLoadBalancePolicy(PyObject *self, PyObj arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); } } - { - std::string *ptr = (std::string *)0; - res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GrpcConfig_setLoadBalancePolicy" "', argument " "2"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GrpcConfig_setLoadBalancePolicy" "', argument " "2"" of type '" "std::string const &""'"); - } - arg2 = ptr; - } + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setCompressAlgorithm" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); { try { - (arg1)->setLoadBalancePolicy((std::string const &)*arg2); + (arg1)->setCompressAlgorithm(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } resultobj = SWIG_Py_Void(); - if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: - if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_enableHealthCheck(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_maxMsgSize(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; void *argp1 = 0 ; @@ -19537,7 +19607,7 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_enableHealthCheck(PyObject *self, PyObject std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; - bool result; + uint64_t result; (void)self; if (!args) SWIG_fail; @@ -19546,7 +19616,7 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_enableHealthCheck(PyObject *self, PyObject int newmem = 0; res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_enableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_maxMsgSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); @@ -19559,38 +19629,38 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_enableHealthCheck(PyObject *self, PyObject } { try { - result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableHealthCheck(); + result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxMsgSize(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_bool(static_cast< bool >(result)); + resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_setEnableHealthCheck(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcConfig_setMaxMsgSize(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - bool arg2 ; + uint64_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; - bool val2 ; + unsigned long long val2 ; int ecode2 = 0 ; PyObject *swig_obj[2] ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setEnableHealthCheck", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setMaxMsgSize", 2, 2, swig_obj)) SWIG_fail; { int newmem = 0; res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setEnableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setMaxMsgSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); } if (newmem & SWIG_CAST_NEW_MEMORY) { tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); @@ -19601,14 +19671,14 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_setEnableHealthCheck(PyObject *self, PyObj arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); } } - ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setEnableHealthCheck" "', argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setMaxMsgSize" "', argument " "2"" of type '" "uint64_t""'"); } - arg2 = static_cast< bool >(val2); + arg2 = static_cast< uint64_t >(val2); { try { - (arg1)->setEnableHealthCheck(arg2); + (arg1)->setMaxMsgSize(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); @@ -19621,382 +19691,366 @@ SWIGINTERN PyObject *_wrap_GrpcConfig_setEnableHealthCheck(PyObject *self, PyObj } -SWIGINTERN PyObject *_wrap_GrpcConfig_setEnableDnslookup(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *GrpcConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *GrpcConfig_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject *_wrap_new_GrpcServerConfig__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + ppc::protocol::GrpcServerConfig *result = 0 ; + + (void)self; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; + { + try { + result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(); + } + catch (const std::exception& e) { + SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__GrpcServerConfig, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_GrpcServerConfig__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + ppc::protocol::EndPoint arg1 ; bool arg2 ; - void *argp1 = 0 ; + void *argp1 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; bool val2 ; int ecode2 = 0 ; - PyObject *swig_obj[2] ; + ppc::protocol::GrpcServerConfig *result = 0 ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setEnableDnslookup", 2, 2, swig_obj)) SWIG_fail; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setEnableDnslookup" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GrpcServerConfig" "', argument " "1"" of type '" "ppc::protocol::EndPoint""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GrpcServerConfig" "', argument " "1"" of type '" "ppc::protocol::EndPoint""'"); } else { - smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + ppc::protocol::EndPoint * temp = reinterpret_cast< ppc::protocol::EndPoint * >(argp1); + arg1 = *temp; + if (SWIG_IsNewObj(res1)) delete temp; } } ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setEnableDnslookup" "', argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GrpcServerConfig" "', argument " "2"" of type '" "bool""'"); } arg2 = static_cast< bool >(val2); { try { - (arg1)->setEnableDnslookup(arg2); + result = (ppc::protocol::GrpcServerConfig *)new ppc::protocol::GrpcServerConfig(arg1,arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__GrpcServerConfig, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_enableDnslookup(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_new_GrpcServerConfig(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "new_GrpcServerConfig", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 0) { + return _wrap_new_GrpcServerConfig__SWIG_0(self, argc, argv); + } + if (argc == 2) { + int _v = 0; + int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_ppc__protocol__EndPoint, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_bool(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_GrpcServerConfig__SWIG_1(self, argc, argv); + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_GrpcServerConfig'.\n" + " Possible C/C++ prototypes are:\n" + " ppc::protocol::GrpcServerConfig::GrpcServerConfig()\n" + " ppc::protocol::GrpcServerConfig::GrpcServerConfig(ppc::protocol::EndPoint,bool)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_GrpcServerConfig_listenEndPoint(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; - bool result; + std::string result; (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_enableDnslookup" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); - } + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_listenEndPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig const *""'"); } + arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - result = (bool)((ppc::protocol::GrpcConfig const *)arg1)->enableDnslookup(); + result = ((ppc::protocol::GrpcServerConfig const *)arg1)->listenEndPoint(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_bool(static_cast< bool >(result)); + resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_maxSendMessageSize(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcServerConfig_setEndPoint(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + ppc::protocol::EndPoint arg2 ; void *argp1 = 0 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - PyObject *swig_obj[1] ; - uint64_t result; + void *argp2 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; (void)self; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "GrpcServerConfig_setEndPoint", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_setEndPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig *""'"); + } + arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_maxSendMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GrpcServerConfig_setEndPoint" "', argument " "2"" of type '" "ppc::protocol::EndPoint""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GrpcServerConfig_setEndPoint" "', argument " "2"" of type '" "ppc::protocol::EndPoint""'"); } else { - smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); + ppc::protocol::EndPoint * temp = reinterpret_cast< ppc::protocol::EndPoint * >(argp2); + arg2 = *temp; + if (SWIG_IsNewObj(res2)) delete temp; } } { try { - result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxSendMessageSize(); + (arg1)->setEndPoint(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_maxReceivedMessageSize(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcServerConfig_setEnableHealthCheck(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; + bool arg2 ; void *argp1 = 0 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; - PyObject *swig_obj[1] ; - uint64_t result; + bool val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; (void)self; - if (!args) SWIG_fail; - swig_obj[0] = args; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_maxReceivedMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); - } + if (!SWIG_Python_UnpackTuple(args, "GrpcServerConfig_setEnableHealthCheck", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_setEnableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig *""'"); } + arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcServerConfig_setEnableHealthCheck" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); { try { - result = (uint64_t)((ppc::protocol::GrpcConfig const *)arg1)->maxReceivedMessageSize(); + (arg1)->setEnableHealthCheck(arg2); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result)); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_setMaxSendMessageSize(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcServerConfig_endPoint(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - uint64_t arg2 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; - unsigned long long val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; + ppc::protocol::EndPoint *result = 0 ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setMaxSendMessageSize", 2, 2, swig_obj)) SWIG_fail; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setMaxSendMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); - } + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_endPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig const *""'"); } - ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setMaxSendMessageSize" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); + arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - (arg1)->setMaxSendMessageSize(arg2); + result = (ppc::protocol::EndPoint *) &((ppc::protocol::GrpcServerConfig const *)arg1)->endPoint(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_setMaxReceivedMessageSize(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcServerConfig_mutableEndPoint(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - uint64_t arg2 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; - unsigned long long val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; + ppc::protocol::EndPoint *result = 0 ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setMaxReceivedMessageSize", 2, 2, swig_obj)) SWIG_fail; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setMaxReceivedMessageSize" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); - } + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_mutableEndPoint" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig *""'"); } - ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setMaxReceivedMessageSize" "', argument " "2"" of type '" "uint64_t""'"); - } - arg2 = static_cast< uint64_t >(val2); + arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - (arg1)->setMaxReceivedMessageSize(arg2); + result = (ppc::protocol::EndPoint *) &(arg1)->mutableEndPoint(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_Py_Void(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ppc__protocol__EndPoint, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_compressAlgorithm(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcServerConfig_enableHealthCheck(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig const > *smartarg1 = 0 ; PyObject *swig_obj[1] ; - int result; + bool result; (void)self; if (!args) SWIG_fail; swig_obj[0] = args; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_compressAlgorithm" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig const *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< const ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); - } + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_enableHealthCheck" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig const *""'"); } + arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - result = (int)((ppc::protocol::GrpcConfig const *)arg1)->compressAlgorithm(); + result = (bool)((ppc::protocol::GrpcServerConfig const *)arg1)->enableHealthCheck(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_From_int(static_cast< int >(result)); + resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_GrpcConfig_setCompressAlgorithm(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_GrpcServerConfig_grpcConfig(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ppc::protocol::GrpcConfig *arg1 = (ppc::protocol::GrpcConfig *) 0 ; - int arg2 ; + ppc::protocol::GrpcServerConfig *arg1 = (ppc::protocol::GrpcServerConfig *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - std::shared_ptr< ppc::protocol::GrpcConfig > tempshared1 ; - std::shared_ptr< ppc::protocol::GrpcConfig > *smartarg1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; + PyObject *swig_obj[1] ; + ppc::protocol::GrpcConfig::Ptr *result = 0 ; (void)self; - if (!SWIG_Python_UnpackTuple(args, "GrpcConfig_setCompressAlgorithm", 2, 2, swig_obj)) SWIG_fail; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcConfig_setCompressAlgorithm" "', argument " "1"" of type '" "ppc::protocol::GrpcConfig *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - delete reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::GrpcConfig > * >(argp1); - arg1 = const_cast< ppc::protocol::GrpcConfig * >((smartarg1 ? smartarg1->get() : 0)); - } + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ppc__protocol__GrpcServerConfig, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GrpcServerConfig_grpcConfig" "', argument " "1"" of type '" "ppc::protocol::GrpcServerConfig const *""'"); } - ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GrpcConfig_setCompressAlgorithm" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); + arg1 = reinterpret_cast< ppc::protocol::GrpcServerConfig * >(argp1); { try { - (arg1)->setCompressAlgorithm(arg2); + result = (ppc::protocol::GrpcConfig::Ptr *) &((ppc::protocol::GrpcServerConfig const *)arg1)->grpcConfig(); } catch (const std::exception& e) { SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); } } - resultobj = SWIG_Py_Void(); + { + std::shared_ptr< ppc::protocol::GrpcConfig > *smartresult = *result ? new std::shared_ptr< ppc::protocol::GrpcConfig >(*result) : 0; + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(smartresult), SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, SWIG_POINTER_OWN); + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *GrpcConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *GrpcServerConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_std__shared_ptrT_ppc__protocol__GrpcConfig_t, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_ppc__protocol__GrpcServerConfig, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } -SWIGINTERN PyObject *GrpcConfig_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *GrpcServerConfig_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { return SWIG_Python_InitShadowInstance(args); } @@ -22929,59 +22983,6 @@ SWIGINTERN PyObject *_wrap_Message_payloadBuffer(PyObject *self, PyObject *args) } -SWIGINTERN PyObject *_wrap_Message_setFrontMessage(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; - ppc::protocol::MessagePayload::Ptr arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - std::shared_ptr< ppc::protocol::Message > tempshared1 ; - std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - - (void)self; - if (!SWIG_Python_UnpackTuple(args, "Message_setFrontMessage", 2, 2, swig_obj)) SWIG_fail; - { - int newmem = 0; - res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_setFrontMessage" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); - } - if (newmem & SWIG_CAST_NEW_MEMORY) { - tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); - delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); - arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); - } else { - smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); - arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); - } - } - { - int newmem = 0; - res2 = SWIG_ConvertPtrAndOwn(swig_obj[1], &argp2, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__MessagePayload_t, 0 , &newmem); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Message_setFrontMessage" "', argument " "2"" of type '" "ppc::protocol::MessagePayload::Ptr""'"); - } - if (argp2) arg2 = *(reinterpret_cast< ppc::protocol::MessagePayload::Ptr * >(argp2)); - if (newmem & SWIG_CAST_NEW_MEMORY) delete reinterpret_cast< ppc::protocol::MessagePayload::Ptr * >(argp2); - } - { - try { - (arg1)->setFrontMessage(arg2); - } - catch (const std::exception& e) { - SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_Message_frontMessage(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; @@ -23238,6 +23239,48 @@ SWIGINTERN PyObject *_wrap_Message_payload(PyObject *self, PyObject *args) { } +SWIGINTERN PyObject *_wrap_Message_releasePayload(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::Message *arg1 = (ppc::protocol::Message *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::Message > tempshared1 ; + std::shared_ptr< ppc::protocol::Message > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__Message_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Message_releasePayload" "', argument " "1"" of type '" "ppc::protocol::Message *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::Message > * >(argp1); + arg1 = const_cast< ppc::protocol::Message * >((smartarg1 ? smartarg1->get() : 0)); + } + } + { + try { + (arg1)->releasePayload(); + } + catch (const std::exception& e) { + SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *Message_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; @@ -24799,6 +24842,48 @@ SWIGINTERN PyObject *_wrap_MessagePayload_isRespPacket(PyObject *self, PyObject } +SWIGINTERN PyObject *_wrap_MessagePayload_releasePayload(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ppc::protocol::MessagePayload *arg1 = (ppc::protocol::MessagePayload *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::shared_ptr< ppc::protocol::MessagePayload > tempshared1 ; + std::shared_ptr< ppc::protocol::MessagePayload > *smartarg1 = 0 ; + PyObject *swig_obj[1] ; + + (void)self; + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int newmem = 0; + res1 = SWIG_ConvertPtrAndOwn(swig_obj[0], &argp1, SWIGTYPE_p_std__shared_ptrT_ppc__protocol__MessagePayload_t, 0 | 0 , &newmem); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MessagePayload_releasePayload" "', argument " "1"" of type '" "ppc::protocol::MessagePayload *""'"); + } + if (newmem & SWIG_CAST_NEW_MEMORY) { + tempshared1 = *reinterpret_cast< std::shared_ptr< ppc::protocol::MessagePayload > * >(argp1); + delete reinterpret_cast< std::shared_ptr< ppc::protocol::MessagePayload > * >(argp1); + arg1 = const_cast< ppc::protocol::MessagePayload * >(tempshared1.get()); + } else { + smartarg1 = reinterpret_cast< std::shared_ptr< ppc::protocol::MessagePayload > * >(argp1); + arg1 = const_cast< ppc::protocol::MessagePayload * >((smartarg1 ? smartarg1->get() : 0)); + } + } + { + try { + (arg1)->releasePayload(); + } + catch (const std::exception& e) { + SWIG_exception(SWIG_RuntimeError, std::string(boost::diagnostic_information(e)).c_str()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *MessagePayload_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; @@ -29175,18 +29260,7 @@ static PyMethodDef SwigMethods[] = { { "EndPoint_listenIp", _wrap_EndPoint_listenIp, METH_O, NULL}, { "EndPoint_swigregister", EndPoint_swigregister, METH_O, NULL}, { "EndPoint_swiginit", EndPoint_swiginit, METH_VARARGS, NULL}, - { "new_GrpcServerConfig", _wrap_new_GrpcServerConfig, METH_VARARGS, NULL}, - { "GrpcServerConfig_listenEndPoint", _wrap_GrpcServerConfig_listenEndPoint, METH_O, NULL}, - { "GrpcServerConfig_setEndPoint", _wrap_GrpcServerConfig_setEndPoint, METH_VARARGS, NULL}, - { "GrpcServerConfig_setEnableHealthCheck", _wrap_GrpcServerConfig_setEnableHealthCheck, METH_VARARGS, NULL}, - { "GrpcServerConfig_endPoint", _wrap_GrpcServerConfig_endPoint, METH_O, NULL}, - { "GrpcServerConfig_mutableEndPoint", _wrap_GrpcServerConfig_mutableEndPoint, METH_O, NULL}, - { "GrpcServerConfig_enableHealthCheck", _wrap_GrpcServerConfig_enableHealthCheck, METH_O, NULL}, - { "delete_GrpcServerConfig", _wrap_delete_GrpcServerConfig, METH_O, NULL}, - { "GrpcServerConfig_swigregister", GrpcServerConfig_swigregister, METH_O, NULL}, - { "GrpcServerConfig_swiginit", GrpcServerConfig_swiginit, METH_VARARGS, NULL}, { "new_GrpcConfig", _wrap_new_GrpcConfig, METH_NOARGS, NULL}, - { "delete_GrpcConfig", _wrap_delete_GrpcConfig, METH_O, NULL}, { "GrpcConfig_loadBalancePolicy", _wrap_GrpcConfig_loadBalancePolicy, METH_O, NULL}, { "GrpcConfig_setLoadBalancePolicy", _wrap_GrpcConfig_setLoadBalancePolicy, METH_VARARGS, NULL}, { "GrpcConfig_enableHealthCheck", _wrap_GrpcConfig_enableHealthCheck, METH_O, NULL}, @@ -29199,8 +29273,20 @@ static PyMethodDef SwigMethods[] = { { "GrpcConfig_setMaxReceivedMessageSize", _wrap_GrpcConfig_setMaxReceivedMessageSize, METH_VARARGS, NULL}, { "GrpcConfig_compressAlgorithm", _wrap_GrpcConfig_compressAlgorithm, METH_O, NULL}, { "GrpcConfig_setCompressAlgorithm", _wrap_GrpcConfig_setCompressAlgorithm, METH_VARARGS, NULL}, + { "GrpcConfig_maxMsgSize", _wrap_GrpcConfig_maxMsgSize, METH_O, NULL}, + { "GrpcConfig_setMaxMsgSize", _wrap_GrpcConfig_setMaxMsgSize, METH_VARARGS, NULL}, { "GrpcConfig_swigregister", GrpcConfig_swigregister, METH_O, NULL}, { "GrpcConfig_swiginit", GrpcConfig_swiginit, METH_VARARGS, NULL}, + { "new_GrpcServerConfig", _wrap_new_GrpcServerConfig, METH_VARARGS, NULL}, + { "GrpcServerConfig_listenEndPoint", _wrap_GrpcServerConfig_listenEndPoint, METH_O, NULL}, + { "GrpcServerConfig_setEndPoint", _wrap_GrpcServerConfig_setEndPoint, METH_VARARGS, NULL}, + { "GrpcServerConfig_setEnableHealthCheck", _wrap_GrpcServerConfig_setEnableHealthCheck, METH_VARARGS, NULL}, + { "GrpcServerConfig_endPoint", _wrap_GrpcServerConfig_endPoint, METH_O, NULL}, + { "GrpcServerConfig_mutableEndPoint", _wrap_GrpcServerConfig_mutableEndPoint, METH_O, NULL}, + { "GrpcServerConfig_enableHealthCheck", _wrap_GrpcServerConfig_enableHealthCheck, METH_O, NULL}, + { "GrpcServerConfig_grpcConfig", _wrap_GrpcServerConfig_grpcConfig, METH_O, NULL}, + { "GrpcServerConfig_swigregister", GrpcServerConfig_swigregister, METH_O, NULL}, + { "GrpcServerConfig_swiginit", GrpcServerConfig_swiginit, METH_VARARGS, NULL}, { "printGrpcConfig", _wrap_printGrpcConfig, METH_O, NULL}, { "delete_MessageOptionalHeader", _wrap_delete_MessageOptionalHeader, METH_O, NULL}, { "MessageOptionalHeader_encode", _wrap_MessageOptionalHeader_encode, METH_VARARGS, NULL}, @@ -29261,12 +29347,12 @@ static PyMethodDef SwigMethods[] = { { "Message_setRespPacket", _wrap_Message_setRespPacket, METH_O, NULL}, { "Message_setPayload", _wrap_Message_setPayload, METH_VARARGS, NULL}, { "Message_payloadBuffer", _wrap_Message_payloadBuffer, METH_O, NULL}, - { "Message_setFrontMessage", _wrap_Message_setFrontMessage, METH_VARARGS, NULL}, { "Message_frontMessage", _wrap_Message_frontMessage, METH_O, NULL}, { "Message_encode", _wrap_Message_encode, METH_VARARGS, NULL}, { "Message_decode", _wrap_Message_decode, METH_VARARGS, NULL}, { "Message_length", _wrap_Message_length, METH_O, NULL}, { "Message_payload", _wrap_Message_payload, METH_O, NULL}, + { "Message_releasePayload", _wrap_Message_releasePayload, METH_O, NULL}, { "Message_swigregister", Message_swigregister, METH_O, NULL}, { "delete_MessageHeaderBuilder", _wrap_delete_MessageHeaderBuilder, METH_O, NULL}, { "MessageHeaderBuilder_build", _wrap_MessageHeaderBuilder_build, METH_VARARGS, NULL}, @@ -29294,6 +29380,7 @@ static PyMethodDef SwigMethods[] = { { "MessagePayload_setExt", _wrap_MessagePayload_setExt, METH_VARARGS, NULL}, { "MessagePayload_setRespPacket", _wrap_MessagePayload_setRespPacket, METH_O, NULL}, { "MessagePayload_isRespPacket", _wrap_MessagePayload_isRespPacket, METH_O, NULL}, + { "MessagePayload_releasePayload", _wrap_MessagePayload_releasePayload, METH_O, NULL}, { "MessagePayload_swigregister", MessagePayload_swigregister, METH_O, NULL}, { "delete_MessagePayloadBuilder", _wrap_delete_MessagePayloadBuilder, METH_O, NULL}, { "MessagePayloadBuilder_build", _wrap_MessagePayloadBuilder_build, METH_VARARGS, NULL}, diff --git a/cpp/wedpr-transport/sdk-wrapper/python/swig/wedpr_python_transport.i b/cpp/wedpr-transport/sdk-wrapper/python/swig/wedpr_python_transport.i index 59c6ba39..83be7ca0 100644 --- a/cpp/wedpr-transport/sdk-wrapper/python/swig/wedpr_python_transport.i +++ b/cpp/wedpr-transport/sdk-wrapper/python/swig/wedpr_python_transport.i @@ -41,6 +41,7 @@ from wedpr_python_gateway_sdk.libs import _wedpr_python_transport %shared_ptr(ppc::protocol::GrpcConfig); %shared_ptr(ppc::sdk::Transport); + %{ #define SWIG_FILE_WITH_INIT #include @@ -192,6 +193,10 @@ namespace bcos{ %ignore ppc::protocol::INodeInfo::toJson; %ignore ppc::protocol::INodeInfo::setComponents; %ignore ppc::protocol::INodeInfoFactory; +%ignore ppc::protocol::Message::setFrontMessage; + +%ignore ppc::protocol::GrpcConfig::~GrpcConfig; +%ignore ppc::protocol::GrpcServerConfig::~GrpcServerConfig; /* ///// tests /// %inline {