From 87160070304e257920e163b4bd705ebdd7e54b3b Mon Sep 17 00:00:00 2001 From: zhangt Date: Wed, 20 May 2026 03:16:16 +0000 Subject: [PATCH 01/51] Replay distributed work onto users/qiazh/pre-merge-tikv-bugfix Branch users/zhangt/merge-onto-qiazh ports our shared remote/local pool + per-layer routing changes from users/zhangt/merge-distributed-to-tikv on top of qianxi's TiKV bugfix branch (lock ordering, splitAsync, version check, etc.). Avoids the 21-block ExtraDynamicSearcher.h merge conflict on the merged_spfresh side by replaying instead of merging. Pragmatic approach for heavy files (ExtraDynamicSearcher.h, SPFreshTest.cpp): take our HEAD versions wholesale (which already contain our distributed + MultiChunk logic), and patch only the compile-breaking deltas caused by qianxi's refactors: - PostingCountCache moved from ExtraDynamicSearcher.h to ExtraTiKVController.h - KeyValueIO grew MultiMerge + LogAsyncWaitStatsAndReset virtuals (qianxi version kept; our MultiPut/MultiDelete virtuals re-added on top) - Options/ParameterDefinitionList: kept qianxi version (adds m_globalIDPath) - ThreadPool: kept our add_high + added addfront alias for qianxi callers Index.h / IExtraSearcher.h / SPANNIndex.cpp: applied small additive hooks on top of qianxi (forward-decl WorkerNode, SetWorker/GetSharedSplitPool accessors, BuildIndexInternalLayer + AddIndex worker loop). qianxi bugfixes preserved in those files. Build system: - CMakeLists updated for absl_cord + cordz family (kvproto 25.3 uses absl 2308, anaconda's grpc bundles 2111; explicit linkage avoids DSO-missing-from-command-line) - cmake invoked with gRPC_DIR/Protobuf_DIR/absl_DIR pointing at /usr/local so generated kvproto + libabsl 2308 versions align Verified: SPTAGTest links cleanly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .gitignore | 3 +- AnnService/CMakeLists.txt | 8 +- AnnService/inc/Core/Common/FineGrainedLock.h | 25 +- AnnService/inc/Core/Common/IVersionMap.h | 12 + AnnService/inc/Core/Common/TiKVVersionMap.h | 52 + .../SPANN/Distributed/ConsistentHashRing.h | 93 ++ .../SPANN/Distributed/DispatchCoordinator.h | 364 +++++ .../Core/SPANN/Distributed/DispatcherNode.h | 293 ++++ .../SPANN/Distributed/DistributedProtocol.h | 651 ++++++++ .../inc/Core/SPANN/Distributed/NetworkNode.h | 319 ++++ .../Core/SPANN/Distributed/RemotePostingOps.h | 1325 ++++++++++++++++ .../inc/Core/SPANN/Distributed/WorkerNode.h | 616 ++++++++ .../inc/Core/SPANN/ExtraDynamicSearcher.h | 620 +++++++- .../inc/Core/SPANN/ExtraTiKVController.h | 1 + AnnService/inc/Core/SPANN/IExtraSearcher.h | 17 + AnnService/inc/Core/SPANN/Index.h | 40 + AnnService/inc/Core/VectorIndex.h | 9 + AnnService/inc/Helper/KeyValueIO.h | 14 + AnnService/inc/Helper/ThreadPool.h | 33 +- AnnService/inc/Socket/ConnectionManager.h | 6 +- AnnService/inc/Socket/Packet.h | 36 +- AnnService/inc/Socket/SimpleSerialization.h | 52 + .../src/Core/SPANN/ExtraFileController.cpp | 2 +- AnnService/src/Core/SPANN/SPANNIndex.cpp | 78 +- AnnService/src/Core/VectorIndex.cpp | 25 + AnnService/src/Socket/Connection.cpp | 30 +- AnnService/src/Socket/Server.cpp | 2 +- Test/CMakeLists.txt | 2 +- Test/inc/TestDataGenerator.h | 15 +- Test/src/SPFreshTest.cpp | 1071 +++++++++++-- Test/src/TestDataGenerator.cpp | 12 +- Test/src/main.cpp | 7 +- benchmark.ini | 19 + evaluation/distributed/README.md | 294 ++++ .../configs/benchmark_100m_1node.ini | 71 + .../configs/benchmark_100m_2node.ini | 71 + .../configs/benchmark_100m_template.ini | 71 + .../configs/benchmark_10m_1node.ini | 62 + .../configs/benchmark_10m_2node.ini | 62 + .../configs/benchmark_10m_template.ini | 62 + .../benchmark_insert_dominant_1node.ini | 58 + .../benchmark_insert_dominant_2node.ini | 58 + .../benchmark_insert_dominant_3node.ini | 59 + .../benchmark_insert_dominant_template.ini | 58 + .../distributed/configs/cluster_2node.conf | 31 + .../distributed/configs/cluster_3node.conf | 34 + evaluation/distributed/configs/tikv.toml | 74 + evaluation/distributed/run_distributed.sh | 1364 +++++++++++++++++ 48 files changed, 8050 insertions(+), 231 deletions(-) create mode 100644 AnnService/inc/Core/SPANN/Distributed/ConsistentHashRing.h create mode 100644 AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h create mode 100644 AnnService/inc/Core/SPANN/Distributed/DispatcherNode.h create mode 100644 AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h create mode 100644 AnnService/inc/Core/SPANN/Distributed/NetworkNode.h create mode 100644 AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h create mode 100644 AnnService/inc/Core/SPANN/Distributed/WorkerNode.h create mode 100644 benchmark.ini create mode 100644 evaluation/distributed/README.md create mode 100644 evaluation/distributed/configs/benchmark_100m_1node.ini create mode 100644 evaluation/distributed/configs/benchmark_100m_2node.ini create mode 100644 evaluation/distributed/configs/benchmark_100m_template.ini create mode 100644 evaluation/distributed/configs/benchmark_10m_1node.ini create mode 100644 evaluation/distributed/configs/benchmark_10m_2node.ini create mode 100644 evaluation/distributed/configs/benchmark_10m_template.ini create mode 100644 evaluation/distributed/configs/benchmark_insert_dominant_1node.ini create mode 100644 evaluation/distributed/configs/benchmark_insert_dominant_2node.ini create mode 100644 evaluation/distributed/configs/benchmark_insert_dominant_3node.ini create mode 100644 evaluation/distributed/configs/benchmark_insert_dominant_template.ini create mode 100644 evaluation/distributed/configs/cluster_2node.conf create mode 100644 evaluation/distributed/configs/cluster_3node.conf create mode 100755 evaluation/distributed/configs/tikv.toml create mode 100755 evaluation/distributed/run_distributed.sh diff --git a/.gitignore b/.gitignore index 190ca29d3..e3dc9796a 100644 --- a/.gitignore +++ b/.gitignore @@ -464,4 +464,5 @@ FodyWeavers.xsd *.sln.iml # SPTAG benchmark generated artifacts -*perftest_* +/perftest_* +/evaluation/2026-04-23/output_distributed_hostname_*.json diff --git a/AnnService/CMakeLists.txt b/AnnService/CMakeLists.txt index cd23345fd..299faf3ed 100644 --- a/AnnService/CMakeLists.txt +++ b/AnnService/CMakeLists.txt @@ -10,6 +10,12 @@ include_directories(${Zstd}/lib) file(GLOB_RECURSE HDR_FILES ${AnnService}/inc/Core/*.h ${AnnService}/inc/Helper/*.h) file(GLOB_RECURSE SRC_FILES ${AnnService}/src/Core/*.cpp ${AnnService}/src/Helper/*.cpp) +# Include Socket sources in core lib for PostingRouter +file(GLOB SOCKET_HDR_FILES ${AnnService}/inc/Socket/*.h) +file(GLOB SOCKET_SRC_FILES ${AnnService}/src/Socket/*.cpp) +list(APPEND HDR_FILES ${SOCKET_HDR_FILES}) +list(APPEND SRC_FILES ${SOCKET_SRC_FILES}) + set(SPDK_LIBRARIES "") if (SPDK) set(Spdk ${PROJECT_SOURCE_DIR}/ThirdParty/spdk/build) @@ -73,7 +79,7 @@ endif() add_library (SPTAGLib SHARED ${SRC_FILES} ${HDR_FILES} ${TiKV_PROTO_SOURCES}) target_link_libraries (SPTAGLib DistanceUtils ${RocksDB_LIBRARIES} ${uring_LIBRARIES} libzstd_shared ${NUMA_LIBRARY} ${TBB_LIBRARIES} ${SPDK_LIBRARIES} ${TiKV_LIBRARIES}) add_library (SPTAGLibStatic STATIC ${SRC_FILES} ${HDR_FILES} ${TiKV_PROTO_SOURCES}) -target_link_libraries (SPTAGLibStatic DistanceUtils ${RocksDB_LIBRARIES} ${uring_LIBRARIES} libzstd_static ${NUMA_LIBRARY_STATIC} ${TBB_LIBRARIES} ${SPDK_LIBRARIES} ${TiKV_LIBRARIES}) +target_link_libraries (SPTAGLibStatic DistanceUtils ${RocksDB_LIBRARIES} ${uring_LIBRARIES} libzstd_static ${NUMA_LIBRARY_STATIC} ${TBB_LIBRARIES} ${SPDK_LIBRARIES} ${TiKV_LIBRARIES} ${Boost_LIBRARIES}) if (MSVC) # SPANNIndex.cpp can exceed COFF section limits in Debug without /bigobj. diff --git a/AnnService/inc/Core/Common/FineGrainedLock.h b/AnnService/inc/Core/Common/FineGrainedLock.h index 06c8f44d1..5cfad7ac6 100644 --- a/AnnService/inc/Core/Common/FineGrainedLock.h +++ b/AnnService/inc/Core/Common/FineGrainedLock.h @@ -56,10 +56,27 @@ namespace SPTAG return GetLock(idx); } + // Per-posting lock identity. Two indices share a lock iff they are + // the same posting, so external callers can use `hash_func(a) == + // hash_func(b)` as a self-lock guard (e.g. in Split, to skip + // re-locking the same head VID). static inline unsigned hash_func(unsigned idx) { return idx; } + + // Bucket index for the internal mutex-sharded unordered_map of + // per-posting locks. Exposed for callers that need an array sized + // to BucketCount and indexed by the same granularity as the lock + // pool (e.g. ExtraDynamicSearcher::m_remoteBucketLocked). + static inline unsigned BucketIndex(SizeType idx) + { + unsigned key = static_cast(idx); + return ((unsigned)(key * 99991) + _rotl(key, 2) + 101) & BucketMask; + } + + static const int BucketMask = 32767; + static const int BucketCount = BucketMask + 1; private: struct Bucket { std::mutex mutex; @@ -76,14 +93,6 @@ namespace SPTAG return *iter->second; } - static inline unsigned BucketIndex(SizeType idx) - { - unsigned key = static_cast(idx); - return ((unsigned)(key * 99991) + _rotl(key, 2) + 101) & BucketMask; - } - - static const int BucketMask = 32767; - static const int BucketCount = BucketMask + 1; mutable std::unique_ptr m_buckets; }; } diff --git a/AnnService/inc/Core/Common/IVersionMap.h b/AnnService/inc/Core/Common/IVersionMap.h index b939bd534..05d638cd9 100644 --- a/AnnService/inc/Core/Common/IVersionMap.h +++ b/AnnService/inc/Core/Common/IVersionMap.h @@ -43,6 +43,18 @@ namespace SPTAG virtual uint8_t GetVersion(const SizeType& key) = 0; virtual uint8_t GetVersion(const SizeType& key, VersionReadPolicy policy) { return GetVersion(key); } virtual void SetVersion(const SizeType& key, const uint8_t& version) = 0; + + /// Batch SetVersion: apply (vids[i] -> versions[i]) for all i. + /// Default impl is a per-VID loop. TiKV-backed maps override this + /// to group writes by chunk so N records in the same chunk only + /// trigger 1 ReadChunk + 1 WriteChunk RPC pair + virtual void SetVersionBatch(const std::vector& vids, const std::vector& versions) + { + size_t n = std::min(vids.size(), versions.size()); + for (size_t i = 0; i < n; i++) { + SetVersion(vids[i], versions[i]); + } + } /// Increment the version of a VID. /// @param expectedOld If not 0xff, the caller asserts the current version should be this value. /// If TiKV already holds (expectedOld+1)&0x7f, treat as success (another node did the same increment). diff --git a/AnnService/inc/Core/Common/TiKVVersionMap.h b/AnnService/inc/Core/Common/TiKVVersionMap.h index 0dce69ce8..69191fe1b 100644 --- a/AnnService/inc/Core/Common/TiKVVersionMap.h +++ b/AnnService/inc/Core/Common/TiKVVersionMap.h @@ -385,6 +385,58 @@ namespace SPTAG else if (oldVal != 0xfe && version == 0xfe) m_deleted++; } + // Group writes by chunk: 1 ReadChunk + N byte-modifications + 1 WriteChunk + // per chunk, instead of N × (ReadChunk + WriteChunk). + void SetVersionBatch(const std::vector& vids, const std::vector& versions) override + { + size_t n = std::min(vids.size(), versions.size()); + if (n == 0) return; + const SizeType localCount = m_count.load(); + + // Group (idx into vids/versions) by chunk id. + std::unordered_map> byChunk; + byChunk.reserve(n); + for (size_t i = 0; i < n; i++) { + SizeType vid = vids[i]; + if (vid < 0 || vid >= localCount) continue; + byChunk[ChunkId(vid)].push_back(i); + } + if (byChunk.empty()) return; + + long deletedDelta = 0; + for (auto& kv : byChunk) { + SizeType cid = kv.first; + auto& idxs = kv.second; + std::lock_guard lock(ChunkMutex(cid)); + std::string chunk = ReadChunkCached(cid); + if (chunk.empty()) { + chunk.assign(m_chunkSize, static_cast(0xff)); + } + bool dirty = false; + for (size_t i : idxs) { + SizeType vid = vids[i]; + uint8_t newVal = versions[i]; + int offset = ChunkOffset(vid); + if (offset < 0 || offset >= (int)chunk.size()) continue; + uint8_t oldVal = static_cast(chunk[offset]); + if (oldVal == newVal) continue; + if (oldVal == 0xfe && newVal != 0xfe) deletedDelta--; + else if (oldVal != 0xfe && newVal == 0xfe) deletedDelta++; + chunk[offset] = static_cast(newVal); + dirty = true; + } + if (dirty) { + auto ret = WriteChunk(cid, chunk); + if (ret != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "TiKVVersionMap::SetVersionBatch: WriteChunk failed chunk=%d layer=%d\n", + cid, m_layer); + } + } + } + if (deletedDelta != 0) m_deleted += deletedDelta; + } + bool IncVersion(const SizeType& key, uint8_t* newVersion, uint8_t expectedOld = 0xff) override { if (key < 0 || key >= m_count.load()) { diff --git a/AnnService/inc/Core/SPANN/Distributed/ConsistentHashRing.h b/AnnService/inc/Core/SPANN/Distributed/ConsistentHashRing.h new file mode 100644 index 000000000..ec5c7855c --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/ConsistentHashRing.h @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once + +#include "inc/Core/Common.h" +#include +#include +#include + +namespace SPTAG::SPANN { + + /// Consistent hash ring for distributing headIDs across compute nodes. + /// Uses virtual nodes (vnodes) for balanced distribution. + /// When nodes are added/removed, only ~1/N of keys are remapped. + class ConsistentHashRing { + public: + explicit ConsistentHashRing(int vnodeCount = 150) + : m_vnodeCount(vnodeCount) {} + + /// Add a physical node to the ring with its virtual nodes. + void AddNode(int nodeIndex) { + for (int i = 0; i < m_vnodeCount; i++) { + uint32_t h = HashVNode(nodeIndex, i); + m_ring[h] = nodeIndex; + } + m_nodes.insert(nodeIndex); + } + + /// Remove a physical node and all its virtual nodes from the ring. + void RemoveNode(int nodeIndex) { + for (int i = 0; i < m_vnodeCount; i++) { + uint32_t h = HashVNode(nodeIndex, i); + m_ring.erase(h); + } + m_nodes.erase(nodeIndex); + } + + /// Find the owner node for a given key (headID). + /// Returns -1 if the ring is empty. + int GetOwner(SizeType headID) const { + if (m_ring.empty()) return -1; + uint32_t h = HashKey(headID); + auto it = m_ring.lower_bound(h); + if (it == m_ring.end()) it = m_ring.begin(); + return it->second; + } + + bool Empty() const { return m_ring.empty(); } + size_t NodeCount() const { return m_nodes.size(); } + bool HasNode(int nodeIndex) const { return m_nodes.count(nodeIndex) > 0; } + const std::set& GetNodes() const { return m_nodes; } + int GetVNodeCount() const { return m_vnodeCount; } + + private: + static uint32_t HashKey(SizeType headID) { + uint32_t hash = 2166136261u; // FNV-1a offset basis + uint32_t val = static_cast(headID); + for (int i = 0; i < 4; i++) { + hash ^= (val >> (i * 8)) & 0xFF; + hash *= 16777619u; // FNV prime + } + return hash; + } + + static uint32_t HashVNode(int nodeIndex, int vnodeIdx) { + // Raw FNV-1a on tiny nodeIndex (1, 2, 3) produces a + // pathologically biased ring (71.9% vs 28.1% for nodes 1/2 with + // 150 vnodes). Pre-mix nodeIndex through Knuth's golden-ratio + // multiplier so small node IDs become full-spectrum uint32 values + // before they hit FNV's accumulator. Validated to give ≈50/50 + // for K=2 and stay within ±15% of even split for K up to 8. + uint32_t saltedVnode = + static_cast(vnodeIdx) ^ + (static_cast(nodeIndex) * 2654435761u); + uint32_t hash = 2166136261u; + auto mix = [&](uint32_t v) { + for (int i = 0; i < 4; i++) { + hash ^= (v >> (i * 8)) & 0xFF; + hash *= 16777619u; + } + }; + mix(saltedVnode); + mix(static_cast(nodeIndex)); + return hash; + } + + int m_vnodeCount; + std::map m_ring; // hash position → nodeIndex + std::set m_nodes; // active physical node indices + }; + +} // namespace SPTAG::SPANN diff --git a/AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h b/AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h new file mode 100644 index 000000000..8bb32a7eb --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once + +#include "inc/Core/SPANN/Distributed/DistributedProtocol.h" +#include "inc/Socket/Client.h" +#include "inc/Socket/Packet.h" +#include "inc/Socket/SimpleSerialization.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace SPTAG::SPANN { + + /// Coordinates driver↔worker dispatch for distributed benchmarks. + /// + /// The driver broadcasts Insert/Search/Stop commands to all workers and + /// collects their results. Workers execute commands via a callback and + /// report results back. + /// + /// This class is independent of posting routing — it only needs a way to + /// send packets to peer nodes (provided via PeerNetwork interface). + class DispatchCoordinator { + public: + /// Abstract interface for sending packets to peer nodes. + /// NetworkNode implements this so DispatchCoordinator doesn't + /// depend on the full node class. + class PeerNetwork { + public: + virtual ~PeerNetwork() = default; + /// Get connection to a peer node (reconnecting if needed). + virtual Socket::ConnectionID GetPeerConnection(int nodeIndex) = 0; + /// Total number of nodes in the cluster. + virtual int GetNumNodes() const = 0; + /// Index of this node. + virtual int GetLocalNodeIndex() const = 0; + /// Send a packet via the client socket. + virtual void SendPacket(Socket::ConnectionID connID, Socket::Packet&& pkt, + std::function callback) = 0; + }; + + using DispatchCallback = std::function; + + DispatchCoordinator() = default; + + ~DispatchCoordinator() { + ClearDispatchCallback(); + } + + /// Attach to a peer network (must outlive this coordinator). + void SetNetwork(PeerNetwork* network) { + m_network = network; + } + + /// Mark a worker node as "local" — its work is done inline by the + /// driver so it should be skipped during broadcast/result collection. + void SetLocalWorkerIndex(int idx) { m_localWorkerIndex = idx; } + + /// Set the callback for executing dispatch commands (worker side). + void SetDispatchCallback(DispatchCallback cb) { + m_dispatchCallback = std::move(cb); + } + + /// Clear the dispatch callback and wait for in-flight dispatch + /// threads to complete. Call before destroying callback state. + void ClearDispatchCallback() { + m_dispatchCallback = nullptr; + std::unique_lock lock(m_activeDispatchMutex); + m_activeDispatchCV.wait(lock, [this]() { + return m_activeDispatchCount == 0; + }); + } + + // ---- Driver side ---- + + /// Broadcast a dispatch command to all worker nodes. + /// Returns the dispatchId assigned to this command. + std::uint64_t BroadcastDispatchCommand(DispatchCommand::Type type, std::uint32_t round) { + std::uint64_t dispatchId = m_nextDispatchId.fetch_add(1); + + DispatchCommand cmd; + cmd.m_type = type; + cmd.m_dispatchId = dispatchId; + cmd.m_round = round; + + int numNodes = m_network->GetNumNodes(); + int localIdx = m_network->GetLocalNodeIndex(); + + // Build list of nodes to skip (dispatcher + local worker if set) + auto shouldSkip = [&](int i) { + return i == localIdx || i == m_localWorkerIndex; + }; + + // Count remote workers (nodes we will actually dispatch to) + int remoteWorkers = 0; + for (int i = 0; i < numNodes; i++) { + if (!shouldSkip(i)) remoteWorkers++; + } + + // Set up pending state for collecting results (not for Stop / Heartbeat) + if (type != DispatchCommand::Type::Stop && + type != DispatchCommand::Type::Heartbeat && + remoteWorkers > 0) { + auto state = std::make_shared(); + state->remaining.store(remoteWorkers); + for (int i = 0; i < numNodes; i++) { + if (!shouldSkip(i)) state->pendingNodes.insert(i); + } + { + std::lock_guard lock(m_dispatchMutex); + m_pendingDispatches[dispatchId] = state; + } + } + + auto bodySize = static_cast(cmd.EstimateBufferSize()); + + for (int i = 0; i < numNodes; i++) { + if (shouldSkip(i)) continue; + + Socket::ConnectionID connID = m_network->GetPeerConnection(i); + if (connID == Socket::c_invalidConnectionID) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "DispatchCoordinator: Cannot dispatch to node %d (no connection)\n", i); + if (type != DispatchCommand::Type::Stop && + type != DispatchCommand::Type::Heartbeat) { + std::lock_guard lock(m_dispatchMutex); + auto it = m_pendingDispatches.find(dispatchId); + if (it != m_pendingDispatches.end()) { + it->second->errors++; + if (it->second->remaining.fetch_sub(1) == 1) { + it->second->done.set_value(); + } + } + } + continue; + } + + Socket::Packet pkt; + pkt.Header().m_packetType = Socket::PacketType::DispatchCommand; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + pkt.Header().m_bodyLength = bodySize; + pkt.AllocateBuffer(bodySize); + cmd.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + m_network->SendPacket(connID, std::move(pkt), nullptr); + } + + // Heartbeats fire every interval seconds — keep logs clean. + if (type != DispatchCommand::Type::Heartbeat) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatchCoordinator: Dispatched %s (id=%llu round=%u) to %d workers\n", + type == DispatchCommand::Type::Search ? "Search" : + type == DispatchCommand::Type::Insert ? "Insert" : "Stop", + (unsigned long long)dispatchId, round, remoteWorkers); + } + + return dispatchId; + } + + /// Wait for all workers to report results for a dispatch. + /// Returns collected wall times from workers. Empty on timeout. + std::vector WaitForAllResults(std::uint64_t dispatchId, int timeoutSec = 300) { + std::shared_ptr state; + { + std::lock_guard lock(m_dispatchMutex); + auto it = m_pendingDispatches.find(dispatchId); + if (it == m_pendingDispatches.end()) return {}; + state = it->second; + } + + auto future = state->done.get_future(); + auto status = future.wait_for(std::chrono::seconds(timeoutSec)); + + { + std::lock_guard lock(m_dispatchMutex); + m_pendingDispatches.erase(dispatchId); + } + + if (status == std::future_status::timeout) { + std::string nodeList; + { + std::lock_guard lock(state->mutex); + for (int n : state->pendingNodes) { + if (!nodeList.empty()) nodeList += ","; + nodeList += std::to_string(n); + } + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "DispatchCoordinator: Timeout waiting for results (id=%llu, %d remaining, nodes=[%s])\n", + (unsigned long long)dispatchId, state->remaining.load(), nodeList.c_str()); + return {}; + } + + if (state->errors > 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "DispatchCoordinator: Dispatch %llu completed with %d errors\n", + (unsigned long long)dispatchId, (int)state->errors); + } + + std::lock_guard lock(state->mutex); + return state->wallTimes; + } + + // ---- Worker side ---- + + /// Send a dispatch result back to the driver (worker side). + void SendDispatchResult(const DispatchResult& result) { + int driverNode = 0; + if (driverNode == m_network->GetLocalNodeIndex()) return; + + Socket::ConnectionID connID = m_network->GetPeerConnection(driverNode); + if (connID == Socket::c_invalidConnectionID) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "DispatchCoordinator: Cannot send result to driver\n"); + return; + } + + Socket::Packet pkt; + auto bodySize = static_cast(result.EstimateBufferSize()); + pkt.Header().m_packetType = Socket::PacketType::DispatchResult; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + pkt.Header().m_bodyLength = bodySize; + pkt.AllocateBuffer(bodySize); + result.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + m_network->SendPacket(connID, std::move(pkt), nullptr); + } + + // ---- Packet handlers (called by NetworkNode's server/client) ---- + + /// Handle an incoming dispatch command from the driver (worker side). + void HandleDispatchCommand(Socket::ConnectionID connID, Socket::Packet packet) { + if (packet.Header().m_bodyLength == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "DispatchCoordinator: Empty DispatchCommand received\n"); + return; + } + + DispatchCommand cmd; + if (cmd.Read(packet.Body()) == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "DispatchCoordinator: DispatchCommand parse failed\n"); + return; + } + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatchCoordinator: Received command type=%d id=%llu round=%u\n", + (int)cmd.m_type, (unsigned long long)cmd.m_dispatchId, cmd.m_round); + + auto callback = m_dispatchCallback; + if (!callback) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "DispatchCoordinator: No callback set, ignoring command\n"); + return; + } + + { + std::lock_guard lock(m_activeDispatchMutex); + m_activeDispatchCount++; + } + + auto self = this; + int localIdx = m_network->GetLocalNodeIndex(); + std::thread([self, callback, cmd, localIdx]() { + DispatchResult result = callback(cmd); + result.m_nodeIndex = localIdx; + result.m_dispatchId = cmd.m_dispatchId; + result.m_round = cmd.m_round; + + if (cmd.m_type != DispatchCommand::Type::Stop && + cmd.m_type != DispatchCommand::Type::Heartbeat) { + self->SendDispatchResult(result); + } + + { + std::lock_guard lock(self->m_activeDispatchMutex); + self->m_activeDispatchCount--; + } + self->m_activeDispatchCV.notify_all(); + }).detach(); + } + + /// Handle an incoming dispatch result from a worker (driver side). + void HandleDispatchResult(Socket::ConnectionID connID, Socket::Packet packet) { + if (packet.Header().m_bodyLength == 0) return; + + DispatchResult result; + if (result.Read(packet.Body()) == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "DispatchCoordinator: DispatchResult parse failed\n"); + return; + } + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatchCoordinator: Result id=%llu round=%u node=%d status=%d wallTime=%.3f\n", + (unsigned long long)result.m_dispatchId, result.m_round, + result.m_nodeIndex, (int)result.m_status, result.m_wallTime); + + std::shared_ptr state; + { + std::lock_guard lock(m_dispatchMutex); + auto it = m_pendingDispatches.find(result.m_dispatchId); + if (it == m_pendingDispatches.end()) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "DispatchCoordinator: Result for unknown dispatch %llu (late/expired)\n", + (unsigned long long)result.m_dispatchId); + return; + } + state = it->second; + } + + if (result.m_status != DispatchResult::Status::Success) { + state->errors++; + } + + { + std::lock_guard lock(state->mutex); + state->wallTimes.push_back(result.m_wallTime); + if (result.m_nodeIndex >= 0) + state->pendingNodes.erase(result.m_nodeIndex); + } + + if (state->remaining.fetch_sub(1) == 1) { + state->done.set_value(); + } + } + + private: + struct PendingDispatch { + std::atomic remaining{0}; + std::atomic errors{0}; + std::promise done; + std::mutex mutex; + std::vector wallTimes; + std::set pendingNodes; // nodes that haven't responded yet + }; + + PeerNetwork* m_network = nullptr; + int m_localWorkerIndex = -1; // driver's worker node to skip in broadcasts + DispatchCallback m_dispatchCallback; + std::atomic m_nextDispatchId{1}; + std::mutex m_dispatchMutex; + std::unordered_map> m_pendingDispatches; + + std::mutex m_activeDispatchMutex; + std::condition_variable m_activeDispatchCV; + int m_activeDispatchCount{0}; + }; + +} // namespace SPTAG::SPANN diff --git a/AnnService/inc/Core/SPANN/Distributed/DispatcherNode.h b/AnnService/inc/Core/SPANN/Distributed/DispatcherNode.h new file mode 100644 index 000000000..00b7bbdb6 --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/DispatcherNode.h @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once + +#include "inc/Core/SPANN/Distributed/NetworkNode.h" + +namespace SPTAG::SPANN { + + /// Dispatcher node: manages the consistent hash ring and coordinates + /// external dispatch commands (Insert/Search/Stop) to worker nodes. + /// + /// The dispatcher does NOT perform search or posting operations. + /// It is a lightweight coordination point that: + /// - Accepts NodeRegister requests from workers + /// - Maintains the authoritative hash ring and broadcasts updates + /// - Tracks per-worker ACK status with retry + /// - Delegates BroadcastDispatchCommand / WaitForAllResults + class DispatcherNode : public NetworkNode { + public: + using DispatchCallback = DispatchCoordinator::DispatchCallback; + + /// Initialize the dispatcher with separate addresses. + /// Builds the full hash ring at startup (workers 1..N). + bool Initialize( + const std::pair& dispatcherAddr, + const std::vector>& workerAddrs, + int vnodeCount = 150) + { + // Build combined addr list: [dispatcher, worker0, worker1, ...] + std::vector> allAddrs; + allAddrs.push_back(dispatcherAddr); + allAddrs.insert(allAddrs.end(), workerAddrs.begin(), workerAddrs.end()); + + if (!InitializeNetwork(0, allAddrs, vnodeCount)) return false; + + // [Bug 30] Dispatcher has no local data shard; mark with -1. + m_numDispatchNodes = 1; + m_numWorkerNodes = static_cast(workerAddrs.size()); + m_workerNodeIndex = -1; + + // Pre-build complete ring with all workers (internal indices 1..N) + int numWorkers = static_cast(workerAddrs.size()); + auto ring = std::make_shared(vnodeCount); + for (int i = 1; i <= numWorkers; i++) { + ring->AddNode(i); + } + std::atomic_store(&m_hashRing, + std::shared_ptr(std::move(ring))); + m_currentRingVersion.store(1); + + m_dispatch.SetNetwork(this); + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: initialized with %d workers, ring v1\n", numWorkers); + return true; + } + + bool Start() { return StartNetwork(); } + + // ---- Dispatch protocol ---- + + /// Mark the driver's local worker node so broadcasts skip it. + void SetLocalWorkerIndex(int idx) { m_dispatch.SetLocalWorkerIndex(idx); } + + std::uint64_t BroadcastDispatchCommand(DispatchCommand::Type type, std::uint32_t round) { + return m_dispatch.BroadcastDispatchCommand(type, round); + } + + std::vector WaitForAllResults(std::uint64_t dispatchId, int timeoutSec = 300) { + return m_dispatch.WaitForAllResults(dispatchId, timeoutSec); + } + + void SetDispatchCallback(DispatchCallback cb) { + m_dispatch.SetDispatchCallback(std::move(cb)); + } + + void ClearDispatchCallback() { + m_dispatch.ClearDispatchCallback(); + } + + // ---- Heartbeat pump ---- + // + // Periodically broadcasts a Heartbeat dispatch to every remote worker. + // Workers use the heartbeat to detect driver failure / network + // partition and exit cleanly rather than relying on a fixed + // wall-clock receiver timeout. + // + // Idempotent: callable from any thread; second call without StopHeartbeat + // is a no-op. StopHeartbeat joins the thread; destructor calls it. + + void StartHeartbeat(int intervalSec) { + if (intervalSec <= 0) return; + if (m_heartbeatThread.joinable()) return; + m_heartbeatStop.store(false); + m_heartbeatThread = std::thread([this, intervalSec]() { + std::uint32_t round = 0; + while (!m_heartbeatStop.load()) { + BroadcastDispatchCommand(DispatchCommand::Type::Heartbeat, round++); + for (int i = 0; i < intervalSec * 10 && !m_heartbeatStop.load(); i++) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + } + }); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: heartbeat pump started (interval=%ds)\n", intervalSec); + } + + void StopHeartbeat() { + if (!m_heartbeatThread.joinable()) return; + m_heartbeatStop.store(true); + m_heartbeatThread.join(); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: heartbeat pump stopped\n"); + } + + ~DispatcherNode() { + StopHeartbeat(); + } + + // ---- Ring management ---- + + bool AllWorkersAcked() const { + std::uint32_t currentVer = m_currentRingVersion.load(); + if (currentVer == 0) return false; + std::lock_guard lock(m_ackMutex); + int numNodes = static_cast(m_nodeAddrs.size()); + for (int i = 0; i < numNodes; i++) { + if (i == m_localNodeIndex) continue; + auto it = m_workerAckedVersion.find(i); + if (it == m_workerAckedVersion.end() || it->second < currentVer) return false; + } + return true; + } + + protected: + void RegisterServerHandlers(Socket::PacketHandlerMapPtr& handlers) override { + handlers->emplace(Socket::PacketType::NodeRegisterRequest, + [this](Socket::ConnectionID c, Socket::Packet p) { HandleNodeRegisterRequest(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::RingUpdateACK, + [this](Socket::ConnectionID c, Socket::Packet p) { HandleRingUpdateACK(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::DispatchCommand, + [this](Socket::ConnectionID c, Socket::Packet p) { m_dispatch.HandleDispatchCommand(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::DispatchResult, + [this](Socket::ConnectionID c, Socket::Packet p) { m_dispatch.HandleDispatchResult(c, std::move(p)); }); + } + + void RegisterClientHandlers(Socket::PacketHandlerMapPtr& handlers) override { + handlers->emplace(Socket::PacketType::DispatchResult, + [this](Socket::ConnectionID c, Socket::Packet p) { m_dispatch.HandleDispatchResult(c, std::move(p)); }); + } + + void BgProtocolStep() override { + if (m_currentRingVersion.load() > 0) { + RetryUnackedRingUpdates(); + } + } + + bool IsRingSettled() const override { + return AllWorkersAcked(); + } + + private: + void HandleNodeRegisterRequest(Socket::ConnectionID connID, Socket::Packet packet) { + NodeRegisterMsg msg; + if (!msg.Read(packet.Body())) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "DispatcherNode: Failed to parse NodeRegisterRequest\n"); + return; + } + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: NodeRegister from node %d (%s:%s, store=%s)\n", + msg.m_nodeIndex, msg.m_host.c_str(), msg.m_port.c_str(), msg.m_store.c_str()); + + // Ring is pre-built at startup, just broadcast current ring to the new connection + BroadcastRingUpdate(); + } + + void HandleRingUpdateACK(Socket::ConnectionID connID, Socket::Packet packet) { + RingUpdateACKMsg msg; + if (!msg.Read(packet.Body())) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "DispatcherNode: Failed to parse RingUpdateACK\n"); + return; + } + { + std::lock_guard lock(m_ackMutex); + auto& ver = m_workerAckedVersion[msg.m_nodeIndex]; + if (msg.m_ringVersion > ver) ver = msg.m_ringVersion; + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: RingUpdateACK from node %d (v%u)\n", + msg.m_nodeIndex, msg.m_ringVersion); + } + + void BroadcastRingUpdate() { + auto ring = std::atomic_load(&m_hashRing); + if (!ring) return; + + std::uint32_t version = m_currentRingVersion.load(); + RingUpdateMsg msg; + msg.m_ringVersion = version; + msg.m_vnodeCount = ring->GetVNodeCount(); + for (int idx : ring->GetNodes()) { + msg.m_nodeIndices.push_back(idx); + } + + std::size_t bodySize = msg.EstimateBufferSize(); + int numNodes = static_cast(m_nodeAddrs.size()); + + for (int i = 0; i < numNodes; i++) { + if (i == m_localNodeIndex) continue; + auto peerConn = GetPeerConnection(i); + if (peerConn == Socket::c_invalidConnectionID) continue; + + Socket::Packet pkt; + pkt.Header().m_packetType = Socket::PacketType::RingUpdate; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + pkt.Header().m_bodyLength = static_cast(bodySize); + pkt.AllocateBuffer(static_cast(bodySize)); + msg.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + m_client->SendPacket(peerConn, std::move(pkt), nullptr); + } + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: Broadcast RingUpdate v%u (%d nodes)\n", + version, (int)msg.m_nodeIndices.size()); + } + + void RetryUnackedRingUpdates() { + auto ring = std::atomic_load(&m_hashRing); + if (!ring) return; + std::uint32_t currentVer = m_currentRingVersion.load(); + if (currentVer == 0) return; + + std::vector unacked; + { + std::lock_guard lock(m_ackMutex); + int numNodes = static_cast(m_nodeAddrs.size()); + for (int i = 0; i < numNodes; i++) { + if (i == m_localNodeIndex) continue; + auto it = m_workerAckedVersion.find(i); + if (it == m_workerAckedVersion.end() || it->second < currentVer) + unacked.push_back(i); + } + } + if (unacked.empty()) return; + + RingUpdateMsg msg; + msg.m_ringVersion = currentVer; + msg.m_vnodeCount = ring->GetVNodeCount(); + for (int idx : ring->GetNodes()) msg.m_nodeIndices.push_back(idx); + std::size_t bodySize = msg.EstimateBufferSize(); + + for (int nodeIdx : unacked) { + auto peerConn = GetPeerConnection(nodeIdx); + if (peerConn == Socket::c_invalidConnectionID) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: RetryUnackedRingUpdates skip node %d (no peer conn)\n", nodeIdx); + continue; + } + + Socket::Packet pkt; + pkt.Header().m_packetType = Socket::PacketType::RingUpdate; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + pkt.Header().m_bodyLength = static_cast(bodySize); + pkt.AllocateBuffer(static_cast(bodySize)); + msg.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + m_client->SendPacket(peerConn, std::move(pkt), nullptr); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "DispatcherNode: Retried RingUpdate to node %d (connID=%u)\n", nodeIdx, peerConn); + } + } + + DispatchCoordinator m_dispatch; + std::atomic m_currentRingVersion{0}; + mutable std::mutex m_ackMutex; + std::unordered_map m_workerAckedVersion; + + std::thread m_heartbeatThread; + std::atomic m_heartbeatStop{false}; + }; + +} // namespace SPTAG::SPANN diff --git a/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h b/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h new file mode 100644 index 000000000..b4da82fcc --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h @@ -0,0 +1,651 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once + +#include "inc/Core/Common.h" +#include "inc/Socket/SimpleSerialization.h" +#include +#include +#include +#include + +namespace SPTAG::SPANN { + + /// Serializable request for remote Append operations sent between compute nodes. + /// MirrorVersion 1 added m_layer to disambiguate which ExtraDynamicSearcher on + /// the receiver side handles the request. Version 0 packets default m_layer=0. + struct RemoteAppendRequest { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 1; } + + SizeType m_headID = 0; + std::string m_headVec; // raw head vector bytes + std::int32_t m_appendNum = 0; + std::string m_appendPosting; // serialized posting data + std::int32_t m_layer = 0; // originating ExtraDynamicSearcher layer + + std::size_t EstimateBufferSize() const { + std::size_t size = 0; + size += sizeof(std::uint16_t) * 2; // version fields + size += sizeof(SizeType); // headID + size += sizeof(std::uint32_t) + m_headVec.size(); // headVec (len-prefixed) + size += sizeof(std::int32_t); // appendNum + size += sizeof(std::uint32_t) + m_appendPosting.size(); // appendPosting (len-prefixed) + size += sizeof(std::int32_t); // layer (mirrorVer >= 1) + return size; + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_headID, p_buffer); + p_buffer = SimpleWriteBuffer(m_headVec, p_buffer); + p_buffer = SimpleWriteBuffer(m_appendNum, p_buffer); + p_buffer = SimpleWriteBuffer(m_appendPosting, p_buffer); + p_buffer = SimpleWriteBuffer(m_layer, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + return Read(p_buffer, nullptr); + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer, const std::uint8_t* p_bufEnd) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, majorVer); + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, mirrorVer); + if (p_buffer == nullptr || majorVer != MajorVersion()) return nullptr; + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_headID); + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_headVec); + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_appendNum); + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_appendPosting); + if (mirrorVer >= 1) { + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_layer); + } else { + m_layer = 0; + } + return p_buffer; + } + }; + + /// Response for remote Append operations. + struct RemoteAppendResponse { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + enum class Status : std::uint8_t { Success = 0, Failed = 1 }; + Status m_status = Status::Success; + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t); + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_status, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + p_buffer = SimpleReadBuffer(p_buffer, m_status); + return p_buffer; + } + }; + + /// Identifies a compute node target for routing decisions. + struct RouteTarget { + int nodeIndex = -1; + bool isLocal = true; + }; + + /// Batch of remote append requests sent to a single node in one round-trip. + struct BatchRemoteAppendRequest { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + std::uint32_t m_count = 0; + std::vector m_items; + + std::size_t EstimateBufferSize() const { + std::size_t size = sizeof(std::uint16_t) * 2; // version + size += sizeof(std::uint32_t); // count + for (auto& item : m_items) size += item.EstimateBufferSize(); + return size; + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_count, p_buffer); + for (auto& item : m_items) p_buffer = item.Write(p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer, std::uint32_t bodyLength = 0) { + using namespace Socket::SimpleSerialization; + const std::uint8_t* bufEnd = (bodyLength > 0) ? (p_buffer + bodyLength) : nullptr; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SafeSimpleReadBuffer(p_buffer, bufEnd, majorVer); + p_buffer = SafeSimpleReadBuffer(p_buffer, bufEnd, mirrorVer); + if (p_buffer == nullptr || majorVer != MajorVersion()) { + m_items.clear(); + return nullptr; + } + p_buffer = SafeSimpleReadBuffer(p_buffer, bufEnd, m_count); + if (p_buffer == nullptr) { + m_items.clear(); + return nullptr; + } + // Reject obviously corrupt counts before allocating + if (bodyLength > 0 && m_count > bodyLength / 8) { + m_items.clear(); + return nullptr; + } + m_items.resize(m_count); + for (std::uint32_t i = 0; i < m_count; i++) { + if (bufEnd && p_buffer >= bufEnd) { + m_items.clear(); + return nullptr; + } + p_buffer = m_items[i].Read(p_buffer, bufEnd); + if (!p_buffer) { + m_items.clear(); + return nullptr; + } + if (bufEnd && p_buffer > bufEnd) { + m_items.clear(); + return nullptr; + } + } + return p_buffer; + } + }; + + /// Response for batch remote append. + struct BatchRemoteAppendResponse { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + std::uint32_t m_successCount = 0; + std::uint32_t m_failCount = 0; + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(std::uint32_t) * 2; + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_successCount, p_buffer); + p_buffer = SimpleWriteBuffer(m_failCount, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + p_buffer = SimpleReadBuffer(p_buffer, m_successCount); + p_buffer = SimpleReadBuffer(p_buffer, m_failCount); + return p_buffer; + } + }; + + /// Cross-node merge hint. Search-side trigger on node X observed that + /// posting `m_headID` (owned by the target node based on consistent-hash + /// ownership) is below the merge threshold. The receiver enqueues a + /// local MergeAsync; the local MergePostings logic decides whether the + /// posting really needs merging at execution time. Fire-and-forget: no + /// response packet, no retry queue. Multiple notifications for the same + /// head are dedup'd by m_mergeList on the receiver. + struct RemoteMergeRequest { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + SizeType m_headID = 0; + std::int32_t m_layer = 0; + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(SizeType) + sizeof(std::int32_t); + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_headID, p_buffer); + p_buffer = SimpleWriteBuffer(m_layer, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer, const std::uint8_t* p_bufEnd) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, majorVer); + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, mirrorVer); + if (p_buffer == nullptr || majorVer != MajorVersion()) return nullptr; + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_headID); + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_layer); + return p_buffer; + } + }; + + /// Batch of cross-node merge hints sent to a single owner node in one + /// fire-and-forget packet. Sender-side dedups by (layer, headID) so + /// each entry appears at most once per flush window. + struct BatchRemoteMergeRequest { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + std::uint32_t m_count = 0; + std::vector m_items; + + std::size_t EstimateBufferSize() const { + std::size_t size = sizeof(std::uint16_t) * 2; + size += sizeof(std::uint32_t); + for (auto& item : m_items) size += item.EstimateBufferSize(); + return size; + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_count, p_buffer); + for (auto& item : m_items) p_buffer = item.Write(p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer, std::uint32_t bodyLength = 0) { + using namespace Socket::SimpleSerialization; + const std::uint8_t* bufEnd = (bodyLength > 0) ? (p_buffer + bodyLength) : nullptr; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SafeSimpleReadBuffer(p_buffer, bufEnd, majorVer); + p_buffer = SafeSimpleReadBuffer(p_buffer, bufEnd, mirrorVer); + if (p_buffer == nullptr || majorVer != MajorVersion()) { + m_items.clear(); + return nullptr; + } + p_buffer = SafeSimpleReadBuffer(p_buffer, bufEnd, m_count); + if (p_buffer == nullptr) { m_items.clear(); return nullptr; } + if (bodyLength > 0 && m_count > bodyLength / 8) { + m_items.clear(); + return nullptr; + } + m_items.resize(m_count); + for (std::uint32_t i = 0; i < m_count; i++) { + if (bufEnd && p_buffer >= bufEnd) { m_items.clear(); return nullptr; } + p_buffer = m_items[i].Read(p_buffer, bufEnd); + if (!p_buffer) { m_items.clear(); return nullptr; } + if (bufEnd && p_buffer > bufEnd) { m_items.clear(); return nullptr; } + } + return p_buffer; + } + }; + + /// Entry in a head sync broadcast: one add or delete of a head node. + /// `m_layer` identifies the originating ExtraDynamicSearcher so the + /// receiver applies the entry to the matching layer's head index + /// (with multi-layer SPANN, layer 0 and layer 1 both broadcast head + /// add/delete; without the layer field every entry would be misrouted + /// to a single shared callback). + struct HeadSyncEntry { + enum class Op : std::uint8_t { Add = 0, Delete = 1 }; + Op op; + SizeType headVID; + std::string headVector; // only for Add; empty for Delete + std::int32_t m_layer = 0; // originating ExtraDynamicSearcher layer + + size_t EstimateBufferSize() const { + return sizeof(std::uint8_t) // op + + sizeof(SizeType) // headVID + + sizeof(std::uint32_t) // headVector length + + headVector.size() + + sizeof(std::int32_t); // layer + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(static_cast(op), p_buffer); + p_buffer = SimpleWriteBuffer(headVID, p_buffer); + std::uint32_t vecLen = static_cast(headVector.size()); + p_buffer = SimpleWriteBuffer(vecLen, p_buffer); + if (vecLen > 0) { + memcpy(p_buffer, headVector.data(), vecLen); + p_buffer += vecLen; + } + p_buffer = SimpleWriteBuffer(m_layer, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint8_t rawOp = 0; + p_buffer = SimpleReadBuffer(p_buffer, rawOp); + op = static_cast(rawOp); + p_buffer = SimpleReadBuffer(p_buffer, headVID); + std::uint32_t vecLen = 0; + p_buffer = SimpleReadBuffer(p_buffer, vecLen); + if (vecLen > 0) { + headVector.assign(reinterpret_cast(p_buffer), vecLen); + p_buffer += vecLen; + } else { + headVector.clear(); + } + p_buffer = SimpleReadBuffer(p_buffer, m_layer); + return p_buffer; + } + }; + + /// Dispatch command from driver to workers (replaces file-based barriers). + struct DispatchCommand { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + enum class Type : std::uint8_t { Search = 0, Insert = 1, Stop = 2, Heartbeat = 3 }; + Type m_type = Type::Search; + std::uint64_t m_dispatchId = 0; // unique ID from driver + std::uint32_t m_round = 0; // search round or insert batch index + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t) + + sizeof(std::uint64_t) + sizeof(std::uint32_t); + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(static_cast(m_type), p_buffer); + p_buffer = SimpleWriteBuffer(m_dispatchId, p_buffer); + p_buffer = SimpleWriteBuffer(m_round, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + std::uint8_t rawType = 0; + p_buffer = SimpleReadBuffer(p_buffer, rawType); + m_type = static_cast(rawType); + p_buffer = SimpleReadBuffer(p_buffer, m_dispatchId); + p_buffer = SimpleReadBuffer(p_buffer, m_round); + return p_buffer; + } + }; + + /// Result from worker back to driver after executing a dispatch command. + struct DispatchResult { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 1; } + + enum class Status : std::uint8_t { Success = 0, Failed = 1 }; + Status m_status = Status::Success; + std::uint64_t m_dispatchId = 0; + std::uint32_t m_round = 0; + double m_wallTime = 0.0; + std::int32_t m_nodeIndex = -1; // which worker sent this result + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t) + + sizeof(std::uint64_t) + sizeof(std::uint32_t) + sizeof(double) + + sizeof(std::int32_t); + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(static_cast(m_status), p_buffer); + p_buffer = SimpleWriteBuffer(m_dispatchId, p_buffer); + p_buffer = SimpleWriteBuffer(m_round, p_buffer); + p_buffer = SimpleWriteBuffer(m_wallTime, p_buffer); + p_buffer = SimpleWriteBuffer(m_nodeIndex, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + std::uint8_t rawStatus = 0; + p_buffer = SimpleReadBuffer(p_buffer, rawStatus); + m_status = static_cast(rawStatus); + p_buffer = SimpleReadBuffer(p_buffer, m_dispatchId); + p_buffer = SimpleReadBuffer(p_buffer, m_round); + p_buffer = SimpleReadBuffer(p_buffer, m_wallTime); + if (mirrorVer >= 1) { + p_buffer = SimpleReadBuffer(p_buffer, m_nodeIndex); + } + return p_buffer; + } + }; + + /// Request to lock/unlock a headID on its owner node (for cross-node Merge). + /// MirrorVersion 1 added m_layer so multi-layer setups dispatch to the + /// correct lock pool (each ExtraDynamicSearcher owns its own bucket flags). + struct RemoteLockRequest { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 1; } + + enum class Op : std::uint8_t { Lock = 0, Unlock = 1 }; + Op m_op = Op::Lock; + SizeType m_headID = 0; + std::int32_t m_layer = 0; + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t) + + sizeof(SizeType) + sizeof(std::int32_t); + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(static_cast(m_op), p_buffer); + p_buffer = SimpleWriteBuffer(m_headID, p_buffer); + p_buffer = SimpleWriteBuffer(m_layer, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + std::uint8_t rawOp = 0; + p_buffer = SimpleReadBuffer(p_buffer, rawOp); + m_op = static_cast(rawOp); + p_buffer = SimpleReadBuffer(p_buffer, m_headID); + if (mirrorVer >= 1) { + p_buffer = SimpleReadBuffer(p_buffer, m_layer); + } else { + m_layer = 0; + } + return p_buffer; + } + }; + + /// Response for remote lock operations. + struct RemoteLockResponse { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + enum class Status : std::uint8_t { Granted = 0, Denied = 1 }; + Status m_status = Status::Granted; + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t); + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(static_cast(m_status), p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + std::uint8_t rawOp = 0; + p_buffer = SimpleReadBuffer(p_buffer, rawOp); + m_status = static_cast(rawOp); + return p_buffer; + } + }; + + /// Worker → dispatcher registration message. + struct NodeRegisterMsg { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + std::int32_t m_nodeIndex = 0; + std::string m_host; + std::string m_port; + std::string m_store; + + std::size_t EstimateBufferSize() const { + std::size_t size = 0; + size += sizeof(std::uint16_t) * 2; + size += sizeof(std::int32_t); + size += sizeof(std::uint32_t) + m_host.size(); + size += sizeof(std::uint32_t) + m_port.size(); + size += sizeof(std::uint32_t) + m_store.size(); + return size; + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_nodeIndex, p_buffer); + p_buffer = SimpleWriteBuffer(m_host, p_buffer); + p_buffer = SimpleWriteBuffer(m_port, p_buffer); + p_buffer = SimpleWriteBuffer(m_store, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + p_buffer = SimpleReadBuffer(p_buffer, m_nodeIndex); + p_buffer = SimpleReadBuffer(p_buffer, m_host); + p_buffer = SimpleReadBuffer(p_buffer, m_port); + p_buffer = SimpleReadBuffer(p_buffer, m_store); + return p_buffer; + } + }; + + /// Dispatcher → worker ring update (full node list, versioned). + struct RingUpdateMsg { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + std::uint32_t m_ringVersion = 0; + std::int32_t m_vnodeCount = 150; + std::vector m_nodeIndices; + + std::size_t EstimateBufferSize() const { + std::size_t size = 0; + size += sizeof(std::uint16_t) * 2; + size += sizeof(std::uint32_t); // ringVersion + size += sizeof(std::int32_t); // vnodeCount + size += sizeof(std::uint32_t); // numNodes + size += sizeof(std::int32_t) * m_nodeIndices.size(); + return size; + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_ringVersion, p_buffer); + p_buffer = SimpleWriteBuffer(m_vnodeCount, p_buffer); + std::uint32_t count = static_cast(m_nodeIndices.size()); + p_buffer = SimpleWriteBuffer(count, p_buffer); + for (auto idx : m_nodeIndices) { + p_buffer = SimpleWriteBuffer(idx, p_buffer); + } + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + p_buffer = SimpleReadBuffer(p_buffer, m_ringVersion); + p_buffer = SimpleReadBuffer(p_buffer, m_vnodeCount); + std::uint32_t count = 0; + p_buffer = SimpleReadBuffer(p_buffer, count); + m_nodeIndices.resize(count); + for (std::uint32_t i = 0; i < count; i++) { + p_buffer = SimpleReadBuffer(p_buffer, m_nodeIndices[i]); + } + return p_buffer; + } + }; + + /// Worker → dispatcher ACK for a ring update. + struct RingUpdateACKMsg { + static constexpr std::uint16_t MajorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 0; } + + std::int32_t m_nodeIndex = -1; + std::uint32_t m_ringVersion = 0; + + std::size_t EstimateBufferSize() const { + return sizeof(std::uint16_t) * 2 + sizeof(std::int32_t) + sizeof(std::uint32_t); + } + + std::uint8_t* Write(std::uint8_t* p_buffer) const { + using namespace Socket::SimpleSerialization; + p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); + p_buffer = SimpleWriteBuffer(m_nodeIndex, p_buffer); + p_buffer = SimpleWriteBuffer(m_ringVersion, p_buffer); + return p_buffer; + } + + const std::uint8_t* Read(const std::uint8_t* p_buffer) { + using namespace Socket::SimpleSerialization; + std::uint16_t majorVer = 0, mirrorVer = 0; + p_buffer = SimpleReadBuffer(p_buffer, majorVer); + p_buffer = SimpleReadBuffer(p_buffer, mirrorVer); + if (majorVer != MajorVersion()) return nullptr; + p_buffer = SimpleReadBuffer(p_buffer, m_nodeIndex); + p_buffer = SimpleReadBuffer(p_buffer, m_ringVersion); + return p_buffer; + } + }; + +} // namespace SPTAG::SPANN diff --git a/AnnService/inc/Core/SPANN/Distributed/NetworkNode.h b/AnnService/inc/Core/SPANN/Distributed/NetworkNode.h new file mode 100644 index 000000000..4e11a4b08 --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/NetworkNode.h @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef _SPTAG_SPANN_NETWORKNODE_H_ +#define _SPTAG_SPANN_NETWORKNODE_H_ + +#include "inc/Core/SPANN/Distributed/DistributedProtocol.h" +#include "inc/Core/SPANN/Distributed/ConsistentHashRing.h" +#include "inc/Core/SPANN/Distributed/DispatchCoordinator.h" +#include "inc/Core/SPANN/Distributed/RemotePostingOps.h" +#include "inc/Socket/Client.h" +#include "inc/Socket/Server.h" +#include "inc/Socket/Packet.h" +#include +#include +#include +#include +#include +#include +#include + +namespace SPTAG::SPANN { + + /// Base class providing shared networking infrastructure for all + /// distributed node roles. Manages server/client sockets, peer + /// connections, consistent hash ring storage, and a background + /// connection maintenance thread. + /// + /// Subclasses override RegisterHandlers() to wire up their specific + /// packet handlers, and BgProtocolStep() / IsRingSettled() for + /// role-specific background work. + class NetworkNode : public DispatchCoordinator::PeerNetwork, + public RemotePostingOps::NetworkAccess { + public: + NetworkNode() + : m_enabled(false), m_localNodeIndex(-1) {} + + virtual ~NetworkNode() { + m_bgConnectStop.store(true); + if (m_bgConnectThread.joinable()) m_bgConnectThread.join(); + } + + /// Initialize shared networking state. + bool InitializeNetwork( + int localNodeIdx, + const std::vector>& nodeAddrs, + int vnodeCount = 150) + { + if (nodeAddrs.empty() || localNodeIdx < 0 || + localNodeIdx >= static_cast(nodeAddrs.size())) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "NetworkNode::Initialize invalid config: %d nodes, localIdx=%d\n", + (int)nodeAddrs.size(), localNodeIdx); + return false; + } + + m_localNodeIndex = localNodeIdx; + m_nodeAddrs = nodeAddrs; + m_vnodeCount = vnodeCount; + + // Start with empty hash ring + std::atomic_store(&m_hashRing, + std::shared_ptr( + std::make_shared(vnodeCount))); + + m_enabled = true; + return true; + } + + /// Start server + client + background connection thread. + /// Subclasses must have called InitializeNetwork() first. + /// Each node listens on its own address from the combined address list. + bool StartNetwork() { + if (!m_enabled) return false; + + // Pre-size m_peerConnections BEFORE the server is started — the + // server's handler threads can dispatch packets immediately on + // bind, and inbound handlers (e.g. HandleRingUpdate -> + // SendRingUpdateACK) call GetPeerConnection which indexes into + // m_peerConnections. Resizing here closes a startup race that + // could segfault when an early peer (typically the dispatcher + // sending the initial RingUpdate) won the race. + m_peerConnections.resize(m_nodeAddrs.size(), Socket::c_invalidConnectionID); + + // --- Client side --- + // Construct the Socket::Client BEFORE starting the + // server. Server handlers (notably HeadSync receiver / ring + // update) can fire as soon as the listening socket accepts a + // peer, and they may call ConnectToPeer → m_client-> + // ConnectToServer. If m_client is still null at that point, + // the call dereferences a null unique_ptr and segfaults + // (Pre-build "All N connection attempts to node X failed" + // crash). Construct the client first so the handler path is + // safe before any socket can be accepted. + Socket::PacketHandlerMapPtr clientHandlers(new Socket::PacketHandlerMap); + RegisterClientHandlers(clientHandlers); + + m_client.reset(new Socket::Client(clientHandlers, 8, 30)); + + // --- Server side --- + { + Socket::PacketHandlerMapPtr serverHandlers(new Socket::PacketHandlerMap); + RegisterServerHandlers(serverHandlers); + + const auto& localAddr = m_nodeAddrs[m_localNodeIndex]; + m_server.reset(new Socket::Server( + localAddr.first, localAddr.second, serverHandlers, 8)); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "NetworkNode server listening on %s:%s\n", + localAddr.first.c_str(), localAddr.second.c_str()); + } + + // --- Background thread --- + m_bgConnectStop.store(false); + m_bgConnectThread = std::thread([this]() { + int numNodes = static_cast(m_nodeAddrs.size()); + int delayMs = 500; + while (!m_bgConnectStop.load()) { + bool allConnected = true; + for (int i = 0; i < numNodes; i++) { + if (i == m_localNodeIndex) continue; + { + std::lock_guard lock(m_connMutex); + if (m_peerConnections[i] != Socket::c_invalidConnectionID) + continue; + } + allConnected = false; + ConnectToPeer(i, 1, 0); + } + + BgProtocolStep(); + + if (allConnected && IsRingSettled()) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "NetworkNode: All peers connected and ring synchronized\n"); + break; + } + std::this_thread::sleep_for(std::chrono::milliseconds(delayMs)); + delayMs = std::min(delayMs + 500, 5000); + } + }); + + return true; + } + + // ---- PeerNetwork + NetworkAccess interface ---- + // + // GetLocalNodeIndex() / GetNumNodes() use NETWORK-SLOT semantics: + // m_nodeAddrs is the flat address table indexed by internal slot + // (slot 0 = dispatcher, slots 1..N = workers). These are the + // values used for raw socket connections and dispatch routing. + // + // For COMPUTE-WORKER semantics (VID interleaving, version-map + // sizing, hash-ring partitioning), use GetNumWorkerNodes() / + // GetWorkerNodeIndex() instead — those exclude the dispatcher + // and use 0-indexed worker shard numbering. Mixing the two + // produces off-by-one shard math + // (AllocateGlobalVID maps to the wrong globalVID range). + + int GetLocalNodeIndex() const override { return m_localNodeIndex; } + + int GetNumNodes() const override { + return static_cast(m_nodeAddrs.size()); + } + + // ---- Compute-role accessors ---- + // + // These describe the LOGICAL cluster composition independent of + // the network slot layout. Subclasses populate the m_num*Nodes / + // m_workerNodeIndex fields during Initialize(). + // + // Use these (NOT GetNumNodes / GetLocalNodeIndex) for: + // * AllocateGlobalVID interleaving math + // * Version-map cross-node bound sizing + // * AddIDCapacity growth multiplier + // * Any "how many shards are storing user data?" question + + int GetNumWorkerNodes() const { return m_numWorkerNodes; } + int GetNumDispatchNodes() const { return m_numDispatchNodes; } + + /// 0-indexed compute-shard position for this node, or -1 if this + /// node is dispatcher-only (has no local data shard). + int GetWorkerNodeIndex() const { return m_workerNodeIndex; } + + Socket::ConnectionID GetPeerConnection(int nodeIndex) override { + { + std::lock_guard lock(m_connMutex); + if (m_peerConnections[nodeIndex] != Socket::c_invalidConnectionID) + return m_peerConnections[nodeIndex]; + } + if (ConnectToPeer(nodeIndex, 5, 1000)) { + std::lock_guard lock(m_connMutex); + return m_peerConnections[nodeIndex]; + } + return Socket::c_invalidConnectionID; + } + + void SendPacket(Socket::ConnectionID connID, Socket::Packet&& pkt, + std::function callback) override { + m_client->SendPacket(connID, std::move(pkt), std::move(callback)); + } + + void InvalidatePeerConnection(int nodeIndex) override { + std::lock_guard lock(m_connMutex); + m_peerConnections[nodeIndex] = Socket::c_invalidConnectionID; + } + + Socket::Client* GetClient() override { return m_client.get(); } + Socket::Server* GetServer() override { return m_server.get(); } + + // ---- Shared accessors ---- + + bool IsEnabled() const { return m_enabled; } + + std::shared_ptr GetHashRing() const { + return std::atomic_load(&m_hashRing); + } + + void SetHashRing(std::shared_ptr ring) { + std::atomic_store(&m_hashRing, std::move(ring)); + } + + bool WaitForAllPeersConnected(int timeoutSec = 120) { + if (!m_enabled) return true; + int numNodes = static_cast(m_nodeAddrs.size()); + auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(timeoutSec); + while (std::chrono::steady_clock::now() < deadline) { + bool allConnected = true; + for (int i = 0; i < numNodes; i++) { + if (i == m_localNodeIndex) continue; + std::lock_guard lock(m_connMutex); + if (m_peerConnections[i] == Socket::c_invalidConnectionID) { + allConnected = false; + break; + } + } + if (allConnected) return true; + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "NetworkNode: Timed out waiting for peer connections (%ds)\n", timeoutSec); + return false; + } + + bool ConnectToPeer(int nodeIndex, int maxRetries = 10, int initialDelayMs = 500) { + if (nodeIndex == m_localNodeIndex) return true; + std::pair addr; + { + std::lock_guard lock(m_connMutex); + if (nodeIndex >= static_cast(m_nodeAddrs.size())) return false; + addr = m_nodeAddrs[nodeIndex]; + } + int delayMs = initialDelayMs; + for (int attempt = 1; attempt <= maxRetries; attempt++) { + ErrorCode ec; + auto connID = m_client->ConnectToServer(addr.first, addr.second, ec); + if (ec == ErrorCode::Success) { + std::lock_guard lock(m_connMutex); + m_peerConnections[nodeIndex] = connID; + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "NetworkNode[local=%d]: Connected to node %d (%s:%s), connID=%u (attempt %d)\n", + m_localNodeIndex, nodeIndex, addr.first.c_str(), addr.second.c_str(), connID, attempt); + return true; + } + if (attempt < maxRetries) { + std::this_thread::sleep_for(std::chrono::milliseconds(delayMs)); + delayMs = std::min(delayMs * 2, 5000); + } + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "NetworkNode: All %d connection attempts to node %d failed\n", + maxRetries, nodeIndex); + return false; + } + + protected: + /// Subclasses register their packet handlers here. + virtual void RegisterServerHandlers(Socket::PacketHandlerMapPtr& handlers) = 0; + virtual void RegisterClientHandlers(Socket::PacketHandlerMapPtr& handlers) = 0; + + /// Called each iteration of the bg thread for role-specific protocol work. + virtual void BgProtocolStep() {} + + /// Return true when ring is fully synchronized for this node's role. + virtual bool IsRingSettled() const { return true; } + + bool m_enabled; + int m_localNodeIndex; + int m_vnodeCount = 150; + + // Compute-role accounting. Set by subclass Initialize(). + // m_workerNodeIndex == -1 means this node has no local data shard + // (dispatcher-only role). See GetNumWorkerNodes() / GetWorkerNodeIndex() + // for the rationale on why these are separate from m_nodeAddrs.size(). + int m_numWorkerNodes = 0; + int m_numDispatchNodes = 0; + int m_workerNodeIndex = -1; + + // Consistent hash ring (lock-free RCU: atomic_load to read, copy-on-write to modify) + std::shared_ptr m_hashRing; + std::mutex m_ringWriteMutex; + + // Node addresses + std::vector> m_nodeAddrs; + + // Networking + std::unique_ptr m_server; + std::unique_ptr m_client; + std::mutex m_connMutex; + std::vector m_peerConnections; + + // Background thread + std::thread m_bgConnectThread; + std::atomic m_bgConnectStop{false}; + }; + +} // namespace SPTAG::SPANN + +#endif // _SPTAG_SPANN_NETWORKNODE_H_ diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h new file mode 100644 index 000000000..577b91876 --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -0,0 +1,1325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#pragma once + +#include "inc/Core/SPANN/Distributed/DistributedProtocol.h" +#include "inc/Helper/ThreadPool.h" +#include "inc/Socket/Client.h" +#include "inc/Socket/Server.h" +#include "inc/Socket/Packet.h" +#include "inc/Socket/SimpleSerialization.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace SPTAG::SPANN { + + // Per-thread hook so the SPDKThreadPool's pre-allocated ExtraWorkSpace + // (initialised once per worker thread, see SPDKThreadPool::initSPDK) can + // be reached from inside the AppendCallback lambda without changing the + // callback signature. BatchAppendItemJob::exec(workspace*, abort*) sets + // this before invoking the callback so the callback skips the per-item + // InitWorkSpace allocation / m_freeWorkSpaceIds churn that otherwise + // serialises 10k-item batches into ~130s on the receiver. + inline thread_local void* tls_preallocAppendWorkSpace = nullptr; + + /// Handles all node-to-node RPC mechanics for internal posting operations: + /// - Append / BatchAppend (forward writes to the correct owner node) + /// - HeadSync (broadcast head index changes to peers) + /// - RemoteLock (cross-node locking for merge/split) + /// + /// This class owns the request/response matching state and serialization + /// logic. It is independent of routing decisions — WorkerNode decides + /// *where* to send, RemotePostingOps handles *how*. + class RemotePostingOps { + public: + using AppendCallback = std::function headVec, + int appendNum, + std::string& appendPosting)>; + + using HeadSyncCallback = std::function; + using RemoteLockCallback = std::function; + + /// Callback for cross-node merge: search on a peer node observed + /// that posting `headID` (which we own) looks underfull. The peer + /// sent a fire-and-forget MergeRequest to us; we just schedule the + /// local MergeAsync. Returns nothing; receiver-side m_mergeList + /// already dedupes repeated triggers, so dropped notifications + /// are recoverable on the next observation. + using MergeCallback = std::function; + + /// Abstract interface for network access (implemented by NetworkNode). + class NetworkAccess { + public: + virtual ~NetworkAccess() = default; + virtual Socket::ConnectionID GetPeerConnection(int nodeIndex) = 0; + virtual void InvalidatePeerConnection(int nodeIndex) = 0; + virtual int GetLocalNodeIndex() const = 0; + virtual int GetNumNodes() const = 0; + virtual Socket::Client* GetClient() = 0; + virtual Socket::Server* GetServer() = 0; + }; + + RemotePostingOps() { + StartHeadSyncRetryThread(); + } + + ~RemotePostingOps() { + StopHeadSyncRetryThread(); + } + + RemotePostingOps(const RemotePostingOps&) = delete; + RemotePostingOps& operator=(const RemotePostingOps&) = delete; + + void SetNetwork(NetworkAccess* net) { m_net = net; } + + // Inject the searcher's shared compute pool. Receiver-side BatchAppend + // work runs as Jobs on this pool so it shares a single bounded- + // concurrency budget with local Append/Split/Merge/Reassign (instead + // of a separate bg executor + transient std::threads which over- + // subscribed TiKV). Per-layer: each layer's ExtraDynamicSearcher owns + // its own m_splitThreadPool, so BatchAppend items dispatch by the + // request's m_layer to the matching pool. A single submitter would + // pile both layers' remote appends into whichever pool wired last. + using JobSubmitter = std::function; + void SetJobSubmitter(int layer, JobSubmitter submitter) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + if (m_jobSubmitters.size() <= static_cast(layer)) { + m_jobSubmitters.resize(static_cast(layer) + 1); + } + m_jobSubmitters[layer] = std::move(submitter); + } + + // Helper: ensure the per-layer registries are wide enough for `layer`. + // Caller must hold m_callbackLifetimeMutex in exclusive mode. + void EnsureLayerSlot_NoLock(int layer) { + if (layer < 0) return; + const size_t needed = static_cast(layer) + 1; + if (m_appendCallbacks.size() < needed) m_appendCallbacks.resize(needed); + if (m_headSyncCallbacks.size() < needed) m_headSyncCallbacks.resize(needed); + if (m_remoteLockCallbacks.size() < needed) m_remoteLockCallbacks.resize(needed); + if (m_mergeCallbacks.size() < needed) m_mergeCallbacks.resize(needed); + if (m_callbackOwners.size() < needed) { + std::vector> grown(needed); + for (size_t i = 0; i < m_callbackOwners.size(); ++i) { + grown[i].store( + m_callbackOwners[i].load(std::memory_order_acquire), + std::memory_order_release); + } + m_callbackOwners = std::move(grown); + } + } + + void SetAppendCallback(int layer, AppendCallback cb) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + m_appendCallbacks[layer] = std::move(cb); + } + void SetHeadSyncCallback(int layer, HeadSyncCallback cb) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + m_headSyncCallbacks[layer] = std::move(cb); + } + void SetRemoteLockCallback(int layer, RemoteLockCallback cb) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + m_remoteLockCallbacks[layer] = std::move(cb); + } + void SetMergeCallback(int layer, MergeCallback cb) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + m_mergeCallbacks[layer] = std::move(cb); + } + + /// Atomically clear ALL callbacks (every layer) and wait for any in-flight + /// callback invocation to finish. Required before the owner of the captured + /// `this` pointer (e.g. ExtraDynamicSearcher) is destroyed, otherwise + /// the lambdas registered via SetXxxCallback would dereference a dangling + /// pointer. + void ClearCallbacks() { + std::unique_lock lk(m_callbackLifetimeMutex); + m_appendCallbacks.clear(); + m_headSyncCallbacks.clear(); + m_remoteLockCallbacks.clear(); + m_mergeCallbacks.clear(); + m_callbackOwners = std::vector>(); + } + + /// Claim ownership of the registered callbacks for a SPECIFIC layer. + /// Each ExtraDynamicSearcher owns its own layer slot; per-layer + /// ownership prevents one layer's destructor from wiping another + /// layer's still-valid callbacks (the original 1-layer design used a + /// single ownership token; with Layers>=2 each layer needs its own). + void ClaimCallbackOwnership(int layer, const void* owner) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + m_callbackOwners[layer].store(owner, std::memory_order_release); + } + + /// Clear callbacks for `layer` ONLY if `owner` is the current registered + /// owner of that layer. Used by ExtraDynamicSearcher destructor: each + /// layer's destructor only clears its own slot. Returns true if cleared. + bool ClearCallbacksIfOwner(int layer, const void* owner) { + std::unique_lock lk(m_callbackLifetimeMutex); + if (layer < 0 || static_cast(layer) >= m_callbackOwners.size()) { + return false; + } + if (m_callbackOwners[layer].load(std::memory_order_acquire) != owner) { + return false; + } + m_appendCallbacks[layer] = nullptr; + m_headSyncCallbacks[layer] = nullptr; + m_remoteLockCallbacks[layer] = nullptr; + if (layer >= 0 && static_cast(layer) < m_mergeCallbacks.size()) { + m_mergeCallbacks[layer] = nullptr; + } + m_callbackOwners[layer].store(nullptr, std::memory_order_release); + return true; + } + + // ----- internal callback lookup helpers (caller holds shared lock) ----- + const AppendCallback* LookupAppendCallback_Locked(int layer) const { + if (layer < 0 || static_cast(layer) >= m_appendCallbacks.size()) return nullptr; + const auto& cb = m_appendCallbacks[layer]; + return cb ? &cb : nullptr; + } + const HeadSyncCallback* LookupHeadSyncCallback_Locked(int layer) const { + if (layer < 0 || static_cast(layer) >= m_headSyncCallbacks.size()) return nullptr; + const auto& cb = m_headSyncCallbacks[layer]; + return cb ? &cb : nullptr; + } + const RemoteLockCallback* LookupRemoteLockCallback_Locked(int layer) const { + if (layer < 0 || static_cast(layer) >= m_remoteLockCallbacks.size()) return nullptr; + const auto& cb = m_remoteLockCallbacks[layer]; + return cb ? &cb : nullptr; + } + // PutPosting/FetchPosting/DeletePosting RPCs lived here historically. + // With shared TiKV every node reads and writes the posting store + // directly (PD routes the key), so the cross-node scatter-gather + // and owner-callback round-trips are unnecessary. + const MergeCallback* LookupMergeCallback_Locked(int layer) const { + if (layer < 0 || static_cast(layer) >= m_mergeCallbacks.size()) return nullptr; + const auto& cb = m_mergeCallbacks[layer]; + return cb ? &cb : nullptr; + } + + // ================================================================== + // Append — single item, synchronous (waits for response) + // ================================================================== + + ErrorCode SendRemoteAppend( + int targetNodeIndex, + int layer, + SizeType headID, + const std::shared_ptr& headVec, + int appendNum, + std::string& appendPosting) + { + Socket::ConnectionID connID = m_net->GetPeerConnection(targetNodeIndex); + if (connID == Socket::c_invalidConnectionID) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Cannot connect to node %d for headID %lld\n", + targetNodeIndex, (std::int64_t)headID); + return ErrorCode::Fail; + } + + RemoteAppendRequest req; + req.m_layer = layer; + req.m_headID = headID; + req.m_headVec = *headVec; + req.m_appendNum = appendNum; + req.m_appendPosting = appendPosting; + + Socket::ResourceID resID = m_nextResourceId.fetch_add(1); + auto [future, _] = CreatePendingResponse(resID); + (void)_; + + Socket::Packet packet; + packet.Header().m_packetType = Socket::PacketType::AppendRequest; + packet.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + packet.Header().m_connectionID = Socket::c_invalidConnectionID; + packet.Header().m_resourceID = resID; + + auto bodySize = static_cast(req.EstimateBufferSize()); + packet.Header().m_bodyLength = bodySize; + packet.AllocateBuffer(bodySize); + req.Write(packet.Body()); + packet.Header().WriteBuffer(packet.HeaderBuffer()); + + m_net->GetClient()->SendPacket(connID, std::move(packet), + MakeSendFailHandler(resID)); + + auto status = future.wait_for(std::chrono::seconds(30)); + if (status == std::future_status::timeout) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Timeout waiting for append response for headID %lld from node %d\n", + (std::int64_t)headID, targetNodeIndex); + ErasePending(resID); + return ErrorCode::Fail; + } + return future.get(); + } + + // ================================================================== + // Append — batch, synchronous with retry + // ================================================================== + + ErrorCode SendBatchRemoteAppend( + int targetNodeIndex, + std::vector& items) + { + if (items.empty()) return ErrorCode::Success; + + // Chunk the batch so a single RPC never exceeds kChunkSize items. + // Large batches (millions of items) cannot be processed by the + // receiver within a single timeout window, causing data loss + // when the request is dropped. Chunking keeps each RPC bounded. + // [v38] Reduced 50000 → 10000 to (a) shrink end-of-batch drain + // tail (final chunk no longer 14s wide) and (b) let multiple + // chunks pipeline on the receiver pool. + // [v43] Back to 50000 — v42 (10k) was throughput-best (906/s) + // but during-insert p50 was 222ms; v43 (50k) trades throughput + // (-22% → 704/s) for during-insert p50 (-36% → 141ms) and big + // recovery in post-insert r1 QPS (47→85). v44 (100k) blew up + // tail drain: a single 100k chunk took 116s on the receiver, + // making end-of-batch drain run 40+ min (vs 8 min at 50k). + // 50k is the sweet spot. + // [v47] With shared-pool receiver (BatchAppendItemJob on + // m_splitThreadPool), 50k chunks still occasionally exceed the + // 180s wait_for window under contention → "Timeout waiting for + // batch response" + retries. Drop to 10k so each RPC's worst-case + // receiver wall-clock is ~6× smaller and stays under the timeout. + constexpr size_t kChunkSize = 3000; + const size_t total = items.size(); + size_t offset = 0; + std::vector chunk; + chunk.reserve(std::min(kChunkSize, total)); + + while (offset < total) { + size_t end = std::min(offset + kChunkSize, total); + chunk.clear(); + chunk.reserve(end - offset); + for (size_t i = offset; i < end; ++i) { + chunk.push_back(std::move(items[i])); + } + + ErrorCode chunkRet = SendBatchRemoteAppendChunk(targetNodeIndex, chunk); + if (chunkRet != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Chunk send failed to node %d (offset=%zu/%zu, chunk=%zu items)\n", + targetNodeIndex, offset, total, end - offset); + return chunkRet; + } + offset = end; + } + return ErrorCode::Success; + } + + private: + ErrorCode SendBatchRemoteAppendChunk( + int targetNodeIndex, + std::vector& items) + { + if (items.empty()) return ErrorCode::Success; + + for (int attempt = 0; attempt < 3; attempt++) { + Socket::ConnectionID connID = m_net->GetPeerConnection(targetNodeIndex); + if (connID == Socket::c_invalidConnectionID) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Cannot connect to node %d for batch (%d items, attempt %d)\n", + targetNodeIndex, (int)items.size(), attempt + 1); + if (attempt < 2) continue; + return ErrorCode::Fail; + } + + BatchRemoteAppendRequest batchReq; + batchReq.m_count = static_cast(items.size()); + batchReq.m_items = std::move(items); + + Socket::ResourceID resID = m_nextResourceId.fetch_add(1); + auto [future, _] = CreatePendingResponse(resID); + (void)_; + + Socket::Packet packet; + packet.Header().m_packetType = Socket::PacketType::BatchAppendRequest; + packet.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + packet.Header().m_connectionID = Socket::c_invalidConnectionID; + packet.Header().m_resourceID = resID; + + auto bodySize = static_cast(batchReq.EstimateBufferSize()); + packet.Header().m_bodyLength = bodySize; + packet.AllocateBuffer(bodySize); + batchReq.Write(packet.Body()); + items = std::move(batchReq.m_items); // restore for retry + + packet.Header().WriteBuffer(packet.HeaderBuffer()); + + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, + "RemotePostingOps: Sending batch of %u appends to node %d (resID=%u, attempt=%d)\n", + batchReq.m_count, targetNodeIndex, resID, attempt + 1); + + auto waitStart = std::chrono::steady_clock::now(); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "RemotePostingOps: BatchAppendChunk -> node %d (resID=%u, attempt=%d, items=%u) wait_start\n", + targetNodeIndex, resID, attempt + 1, batchReq.m_count); + + m_net->GetClient()->SendPacket(connID, std::move(packet), + MakeSendFailHandler(resID)); + + // Generous timeout: 50k items * (~10ms TiKV roundtrip / 16 worker threads) + // = ~31s typical; cap at 180s to allow for lock contention with merges/splits. + auto status = future.wait_for(std::chrono::seconds(180)); + auto waitMs = std::chrono::duration_cast( + std::chrono::steady_clock::now() - waitStart).count(); + if (status == std::future_status::timeout) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Timeout waiting for batch response from node %d (chunk=%u items, attempt=%d, waited=%lldms)\n", + targetNodeIndex, batchReq.m_count, attempt + 1, (long long)waitMs); + ErasePending(resID); + // Do NOT invalidate the connection on timeout — a slow + // response is not a broken connection, and reconnecting + // floods the worker's accept loop. Real connection errors + // are signalled via MakeSendFailHandler (which sets the + // promise to Fail, taking the "result != Success" path + // below). + if (attempt < 2) continue; + return ErrorCode::Fail; + } + + ErrorCode result = future.get(); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "RemotePostingOps: BatchAppendChunk <- node %d (resID=%u, attempt=%d, items=%u, waited=%lldms, result=%d)\n", + targetNodeIndex, resID, attempt + 1, batchReq.m_count, (long long)waitMs, (int)result); + if (result == ErrorCode::Success) return ErrorCode::Success; + + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: Batch to node %d failed (attempt %d), reconnecting...\n", + targetNodeIndex, attempt + 1); + m_net->InvalidatePeerConnection(targetNodeIndex); + } + return ErrorCode::Fail; + } + + public: + + // ================================================================== + // HeadSync — fire-and-forget broadcast + // ================================================================== + + void BroadcastHeadSync(const std::vector& entries) { + if (entries.empty()) return; + + int numNodes = m_net->GetNumNodes(); + int localIdx = m_net->GetLocalNodeIndex(); + + // Count once per peer for sent-entry totals. + std::uint64_t targetCount = 0; + for (int i = 0; i < numNodes; i++) { + if (i != localIdx) targetCount++; + } + m_headSyncBroadcastEntries.fetch_add(entries.size() * targetCount, + std::memory_order_relaxed); + + for (int i = 0; i < numNodes; i++) { + if (i == localIdx) continue; + // Pass a copy of `entries` per peer so each can be re-enqueued + // into its own retry backlog independently on send failure. + SendOneHeadSync(i, std::vector(entries), + /*isRetry=*/false); + } + } + + // Send a HeadSync packet to a single peer. On TCP-level send failure + // (success=false reported by the network stack), the entries are + // appended to the per-peer retry backlog so the background retry + // thread can re-attempt delivery. Counter increments are done + // best-effort once the SendPacket completion lambda fires. + void SendOneHeadSync(int nodeIdx, + std::vector entries, + bool isRetry) + { + if (entries.empty()) return; + + Socket::ConnectionID connID = m_net->GetPeerConnection(nodeIdx); + if (connID == Socket::c_invalidConnectionID) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: HeadSync no connection to node %d (count=%zu, isRetry=%d)\n", + nodeIdx, entries.size(), isRetry ? 1 : 0); + EnqueueHeadSyncRetry(nodeIdx, std::move(entries)); + return; + } + + size_t bodySize = sizeof(std::uint32_t); + for (const auto& e : entries) bodySize += e.EstimateBufferSize(); + + Socket::Packet pkt; + pkt.Header().m_packetType = Socket::PacketType::HeadSyncRequest; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + pkt.Header().m_bodyLength = static_cast(bodySize); + pkt.AllocateBuffer(static_cast(bodySize)); + + std::uint8_t* buf = pkt.Body(); + buf = Socket::SimpleSerialization::SimpleWriteBuffer( + static_cast(entries.size()), buf); + for (const auto& e : entries) buf = e.Write(buf); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + const std::uint64_t sentCount = entries.size(); + std::shared_ptr> entriesShared = + std::make_shared>(std::move(entries)); + const bool wasRetry = isRetry; + + m_net->GetClient()->SendPacket(connID, std::move(pkt), + [this, nodeIdx, entriesShared, sentCount, wasRetry](bool success) { + if (success) { + m_headSyncBroadcastSendOK.fetch_add(sentCount, + std::memory_order_relaxed); + if (wasRetry) { + m_headSyncRetrySucceeded.fetch_add(sentCount, + std::memory_order_relaxed); + } + } else { + m_headSyncBroadcastSendFail.fetch_add(sentCount, + std::memory_order_relaxed); + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: HeadSync send to node %d FAILED " + "(count=%llu, isRetry=%d) — enqueueing for retry\n", + nodeIdx, + (unsigned long long)sentCount, + wasRetry ? 1 : 0); + m_net->InvalidatePeerConnection(nodeIdx); + EnqueueHeadSyncRetry(nodeIdx, std::move(*entriesShared)); + } + }); + } + + void EnqueueHeadSyncRetry(int nodeIdx, std::vector entries) { + if (entries.empty()) return; + auto backlog = GetOrCreateBacklog(nodeIdx); + std::lock_guard g(backlog->mu); + if (backlog->queue.size() + entries.size() > HeadSyncBacklog::kMaxEntries) { + std::uint64_t dropped = entries.size(); + m_headSyncRetryDropped.fetch_add(dropped, std::memory_order_relaxed); + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: HeadSync retry queue full for node %d " + "(queue=%zu, dropping=%llu) — index will diverge!\n", + nodeIdx, backlog->queue.size(), + (unsigned long long)dropped); + return; + } + for (auto& e : entries) backlog->queue.push_back(std::move(e)); + m_headSyncRetryEnqueued.fetch_add(entries.size(), + std::memory_order_relaxed); + } + + // Pull up to maxBatch entries from the per-peer backlog and re-send + // them. Called from the retry thread and on demand. Returns the + // total number of entries dispatched (including for retry-of-retry). + size_t DrainHeadSyncBacklog(size_t maxBatch = 1024) { + if (!m_net) return 0; + std::vector nodeIdxs; + { + std::shared_lock lk(m_headSyncBacklogsMu); + nodeIdxs.reserve(m_headSyncBacklogs.size()); + for (auto& kv : m_headSyncBacklogs) nodeIdxs.push_back(kv.first); + } + size_t dispatched = 0; + for (int nodeIdx : nodeIdxs) { + auto backlog = GetOrCreateBacklog(nodeIdx); + std::vector batch; + { + std::lock_guard g(backlog->mu); + if (backlog->queue.empty()) continue; + size_t bs = std::min(backlog->queue.size(), maxBatch); + batch.reserve(bs); + for (size_t i = 0; i < bs; i++) { + batch.push_back(std::move(backlog->queue.front())); + backlog->queue.pop_front(); + } + } + size_t bs = batch.size(); + SendOneHeadSync(nodeIdx, std::move(batch), /*isRetry=*/true); + dispatched += bs; + } + return dispatched; + } + + size_t GetHeadSyncBacklogSize() const { + size_t total = 0; + std::vector> snapshot; + { + std::shared_lock lk(m_headSyncBacklogsMu); + snapshot.reserve(m_headSyncBacklogs.size()); + for (auto& kv : m_headSyncBacklogs) snapshot.push_back(kv.second); + } + for (auto& b : snapshot) { + std::lock_guard g(b->mu); + total += b->queue.size(); + } + return total; + } + + // Best-effort log dump of HeadSync delivery counters. Use whenever a + // checkpoint is needed (start/end of insert phase, before query, on + // SaveIndex, etc.). + void DumpHeadSyncStats(const char* label) const { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "[HeadSync stats %s] broadcast_entries=%llu send_ok=%llu send_fail=%llu " + "recv_entries=%llu apply_add=%llu apply_del=%llu " + "retry_enqueued=%llu retry_succeeded=%llu retry_dropped=%llu " + "backlog_now=%zu\n", + label ? label : "", + (unsigned long long)m_headSyncBroadcastEntries.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncBroadcastSendOK.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncBroadcastSendFail.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncRecvEntries.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncApplyAdd.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncApplyDelete.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncRetryEnqueued.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncRetrySucceeded.load(std::memory_order_relaxed), + (unsigned long long)m_headSyncRetryDropped.load(std::memory_order_relaxed), + GetHeadSyncBacklogSize()); + } + + // Counters incremented by the receiver-side HandleHeadSyncRequest / + // AddHeadIndex callback. Public so the ExtraDynamicSearcher + // HeadSyncCallback lambda can bump them after applying each entry. + void NoteHeadSyncApplyAdd() { + m_headSyncApplyAdd.fetch_add(1, std::memory_order_relaxed); + } + void NoteHeadSyncApplyDelete() { + m_headSyncApplyDelete.fetch_add(1, std::memory_order_relaxed); + } + + // Best-effort log dump of cross-node merge-hint channel counters. + // Mirrors DumpHeadSyncStats: sender side tracks how many hints we + // broadcast (send_ok / send_fail); receiver side tracks how many + // hints we got and how many were dropped (callback missing). + void DumpMergeRequestStats(const char* label) const { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "[MergeHint stats %s] send_ok=%llu send_fail=%llu " + "recv_hints=%llu recv_dropped=%llu\n", + label ? label : "", + (unsigned long long)m_mergeBroadcastSendOK.load(std::memory_order_relaxed), + (unsigned long long)m_mergeBroadcastSendFail.load(std::memory_order_relaxed), + (unsigned long long)m_mergeRecvHints.load(std::memory_order_relaxed), + (unsigned long long)m_mergeRecvDropped.load(std::memory_order_relaxed)); + } + + // ================================================================== + // RemoteLock — synchronous request/response + // ================================================================== + + bool SendRemoteLock(int nodeIndex, int layer, SizeType headID, bool lock) { + Socket::ConnectionID connID = m_net->GetPeerConnection(nodeIndex); + if (connID == Socket::c_invalidConnectionID) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: Cannot send remote lock to node %d\n", nodeIndex); + return false; + } + + RemoteLockRequest req; + req.m_op = lock ? RemoteLockRequest::Op::Lock : RemoteLockRequest::Op::Unlock; + req.m_headID = headID; + req.m_layer = layer; + + Socket::ResourceID rid = m_nextResourceId.fetch_add(1); + auto [future, _] = CreatePendingResponse(rid); + (void)_; + + Socket::Packet pkt; + auto bodySize = req.EstimateBufferSize(); + pkt.Header().m_packetType = Socket::PacketType::RemoteLockRequest; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = rid; + pkt.Header().m_bodyLength = static_cast(bodySize); + pkt.AllocateBuffer(static_cast(bodySize)); + req.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + m_net->GetClient()->SendPacket(connID, std::move(pkt), + MakeSendFailHandler(rid)); + + auto status = future.wait_for(std::chrono::milliseconds(5000)); + if (status != std::future_status::ready) { + ErasePending(rid); + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: Lock timeout for headID %lld on node %d\n", + (std::int64_t)headID, nodeIndex); + return false; + } + return future.get() == ErrorCode::Success; + } + + // ================================================================== + // Inbound packet handlers (called by WorkerNode's server/client) + // ================================================================== + + void HandleAppendRequest(Socket::ConnectionID connID, Socket::Packet packet) { + if (packet.Header().m_bodyLength == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Empty AppendRequest\n"); + return; + } + + if (Socket::c_invalidConnectionID == packet.Header().m_connectionID) + packet.Header().m_connectionID = connID; + + RemoteAppendRequest req; + const std::uint8_t* body = packet.Body(); + const std::uint8_t* bodyEnd = body + packet.Header().m_bodyLength; + if (req.Read(body, bodyEnd) == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: AppendRequest version mismatch\n"); + SendAppendResponse(packet, RemoteAppendResponse::Status::Failed); + return; + } + + ErrorCode result = ErrorCode::Fail; + { + std::shared_lock cbLock(m_callbackLifetimeMutex); + const auto* cb = LookupAppendCallback_Locked(req.m_layer); + if (cb) { + auto headVec = std::make_shared(std::move(req.m_headVec)); + result = (*cb)( + req.m_headID, headVec, req.m_appendNum, req.m_appendPosting); + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: AppendRequest layer=%d has no callback registered\n", + req.m_layer); + } + } + + auto status = (result == ErrorCode::Success) + ? RemoteAppendResponse::Status::Success + : RemoteAppendResponse::Status::Failed; + SendAppendResponse(packet, status); + } + + void HandleAppendResponse(Socket::ConnectionID connID, Socket::Packet packet) { + Socket::ResourceID resID = packet.Header().m_resourceID; + auto promise = TakePendingResponse(resID); + if (!promise) return; + + if (packet.Header().m_processStatus != Socket::PacketProcessStatus::Ok) { + promise->set_value(ErrorCode::Fail); + return; + } + + RemoteAppendResponse resp; + if (resp.Read(packet.Body()) == nullptr) { + promise->set_value(ErrorCode::Fail); + return; + } + + promise->set_value( + resp.m_status == RemoteAppendResponse::Status::Success + ? ErrorCode::Success : ErrorCode::Fail); + } + + void HandleBatchAppendRequest(Socket::ConnectionID connID, Socket::Packet packet) { + if (packet.Header().m_bodyLength == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Empty BatchAppendRequest\n"); + return; + } + + if (Socket::c_invalidConnectionID == packet.Header().m_connectionID) + packet.Header().m_connectionID = connID; + + auto batchReq = std::make_shared(); + if (batchReq->Read(packet.Body(), packet.Header().m_bodyLength) == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: BatchAppendRequest parse failed\n"); + SendBatchAppendResponse(packet, 0, 1); + return; + } + + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, + "RemotePostingOps: Received batch of %u appends\n", batchReq->m_count); + + // Submit each item as a high-priority Job to the searcher's + // shared compute pool. Pool workers run the local Append callback + // exactly like a local insert would. Last completion ACKs the + // sender. This puts remote work on the SAME concurrency budget + // as local Split/Merge/Reassign — eliminating the over-subscribed + // TiKV behaviour of the old separate bg executor + transient + // sub-worker threads. + auto packetPtr = std::make_shared(std::move(packet)); + const size_t total = batchReq->m_items.size(); + if (total == 0) { + SendBatchAppendResponse(*packetPtr, 0, 0); + return; + } + auto remaining = std::make_shared>(total); + auto successCount = std::make_shared>(0); + auto failCount = std::make_shared>(0); + + if (m_jobSubmitters.empty()) { + // Fallback: process inline on the network thread. Should not + // happen once ExtraDynamicSearcher has wired its pool. + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: no job submitter wired; running BatchAppend synchronously\n"); + std::shared_lock cbLock(m_callbackLifetimeMutex); + for (auto& req : batchReq->m_items) { + ErrorCode r = ErrorCode::Fail; + const auto* cb = LookupAppendCallback_Locked(req.m_layer); + if (cb) { + auto hv = std::make_shared(std::move(req.m_headVec)); + r = (*cb)(req.m_headID, hv, req.m_appendNum, req.m_appendPosting); + } + (r == ErrorCode::Success ? *successCount : *failCount).fetch_add(1); + } + SendBatchAppendResponse(*packetPtr, successCount->load(), failCount->load()); + return; + } + + for (size_t i = 0; i < total; i++) { + auto* job = new BatchAppendItemJob( + this, batchReq, i, remaining, successCount, failCount, packetPtr); + // Route to the per-layer searcher pool matching this item's + // m_layer so local Append/Split/Merge on layer N and remote + // appends targeting layer N share the same 16-thread budget. + // A single global submitter sent both layers' work into one + // pool, causing 35k+ queue depth on the receiver side. + int layer = batchReq->m_items[i].m_layer; + const JobSubmitter* sub = nullptr; + if (layer >= 0 && static_cast(layer) < m_jobSubmitters.size() + && m_jobSubmitters[layer]) { + sub = &m_jobSubmitters[layer]; + } else { + // Layer's pool not yet wired — fall back to whichever + // submitter we have. + for (auto& s : m_jobSubmitters) { if (s) { sub = &s; break; } } + } + // Normal priority. Per-layer routing (m_jobSubmitters[layer]) + // already isolates layer-N append items from other layers' + // pools. High priority starved split entirely (split:N + // in_flight, 0 completed) because once all 16 worker threads + // are running long-tail append items, fresh high-prio appends + // keep cutting in front of split. Append throughput per chunk + // is limited by pool concurrency × per-item RMW; widen the + // pool (AppendThreadNum) instead of using priority hacks. + if (sub) (*sub)(job, /*high=*/false); + else { delete job; failCount->fetch_add(1); remaining->fetch_sub(1); } + } + } + + void HandleBatchAppendResponse(Socket::ConnectionID connID, Socket::Packet packet) { + Socket::ResourceID resID = packet.Header().m_resourceID; + auto promise = TakePendingResponse(resID); + if (!promise) return; + + if (packet.Header().m_processStatus != Socket::PacketProcessStatus::Ok) { + promise->set_value(ErrorCode::Fail); + return; + } + + BatchRemoteAppendResponse resp; + if (resp.Read(packet.Body()) == nullptr) { + promise->set_value(ErrorCode::Fail); + return; + } + + promise->set_value(resp.m_failCount == 0 ? ErrorCode::Success : ErrorCode::Fail); + } + + void HandleHeadSyncRequest(Socket::ConnectionID connID, Socket::Packet packet) { + std::shared_lock cbLock(m_callbackLifetimeMutex); + if (m_headSyncCallbacks.empty()) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: HeadSyncRequest but no callbacks registered\n"); + return; + } + + const std::uint8_t* buf = packet.Body(); + const std::uint8_t* bufEnd = buf + packet.Header().m_bodyLength; + std::uint32_t entryCount = 0; + buf = Socket::SimpleSerialization::SimpleReadBuffer(buf, entryCount); + + std::uint32_t bodyLength = packet.Header().m_bodyLength; + if (bodyLength < sizeof(std::uint32_t) || + entryCount > (bodyLength - sizeof(std::uint32_t)) / 8) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: HeadSyncRequest entryCount=%u exceeds bodyLength=%u\n", + entryCount, bodyLength); + return; + } + + for (std::uint32_t i = 0; i < entryCount; i++) { + if (buf >= bufEnd) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: HeadSync buffer overrun at entry %u/%u\n", i, entryCount); + break; + } + HeadSyncEntry entry; + buf = entry.Read(buf); + if (!buf || buf > bufEnd) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: HeadSync parse error at entry %u/%u\n", i, entryCount); + break; + } + m_headSyncRecvEntries.fetch_add(1, std::memory_order_relaxed); + const auto* cb = LookupHeadSyncCallback_Locked(entry.m_layer); + if (cb) { + (*cb)(entry); + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: HeadSyncEntry layer=%d has no callback registered (op=%d, vid=%d)\n", + entry.m_layer, static_cast(entry.op), (int)entry.headVID); + } + } + } + + // ================================================================== + // Merge — fire-and-forget cross-node hint + // ================================================================== + + /// Send a batch of merge hints to one peer. Fire-and-forget: no + /// response is expected and no retry queue is maintained. Receiver- + /// side m_mergeList dedups, and the owner discovers underfull + /// postings through its own paths (own search, own Append) if any + /// notification is dropped. + void SendBatchRemoteMerge(int targetNodeIndex, + const std::vector& items) + { + if (items.empty()) return; + + Socket::ConnectionID connID = m_net->GetPeerConnection(targetNodeIndex); + if (connID == Socket::c_invalidConnectionID) { + m_mergeBroadcastSendFail.fetch_add(items.size(), std::memory_order_relaxed); + return; + } + + BatchRemoteMergeRequest batch; + batch.m_count = static_cast(items.size()); + batch.m_items = items; + + Socket::Packet pkt; + pkt.Header().m_packetType = Socket::PacketType::MergeRequest; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + + auto bodySize = static_cast(batch.EstimateBufferSize()); + pkt.Header().m_bodyLength = bodySize; + pkt.AllocateBuffer(bodySize); + batch.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + const std::uint64_t sentCount = items.size(); + m_net->GetClient()->SendPacket(connID, std::move(pkt), + [this, targetNodeIndex, sentCount](bool success) { + if (success) { + m_mergeBroadcastSendOK.fetch_add(sentCount, std::memory_order_relaxed); + } else { + m_mergeBroadcastSendFail.fetch_add(sentCount, std::memory_order_relaxed); + m_net->InvalidatePeerConnection(targetNodeIndex); + } + }); + } + + void HandleMergeRequest(Socket::ConnectionID connID, Socket::Packet packet) { + (void)connID; + BatchRemoteMergeRequest batch; + if (batch.Read(packet.Body(), packet.Header().m_bodyLength) == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: MergeRequest parse failed (bodyLength=%u)\n", + packet.Header().m_bodyLength); + return; + } + + std::shared_lock cbLock(m_callbackLifetimeMutex); + for (const auto& item : batch.m_items) { + const auto* cb = LookupMergeCallback_Locked(item.m_layer); + if (cb) { + (*cb)(item.m_headID); + m_mergeRecvHints.fetch_add(1, std::memory_order_relaxed); + } else { + m_mergeRecvDropped.fetch_add(1, std::memory_order_relaxed); + } + } + } + + void HandleRemoteLockRequest(Socket::ConnectionID connID, Socket::Packet packet) { + RemoteLockRequest req; + if (req.Read(packet.Body()) == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "RemotePostingOps: Failed to parse RemoteLockRequest\n"); + return; + } + + RemoteLockResponse resp; + resp.m_status = RemoteLockResponse::Status::Denied; + + { + std::shared_lock cbLock(m_callbackLifetimeMutex); + const auto* cb = LookupRemoteLockCallback_Locked(req.m_layer); + if (cb) { + bool isLock = (req.m_op == RemoteLockRequest::Op::Lock); + bool success = (*cb)(req.m_headID, isLock); + if (success) resp.m_status = RemoteLockResponse::Status::Granted; + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: RemoteLockRequest layer=%d has no callback registered\n", + req.m_layer); + } + } + + Socket::Packet ret; + auto bodySize = resp.EstimateBufferSize(); + ret.Header().m_packetType = Socket::PacketType::RemoteLockResponse; + ret.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + ret.Header().m_connectionID = connID; + ret.Header().m_resourceID = packet.Header().m_resourceID; + ret.Header().m_bodyLength = static_cast(bodySize); + ret.AllocateBuffer(static_cast(bodySize)); + resp.Write(ret.Body()); + ret.Header().WriteBuffer(ret.HeaderBuffer()); + + m_net->GetServer()->SendPacket(connID, std::move(ret), nullptr); + } + + void HandleRemoteLockResponse(Socket::ConnectionID connID, Socket::Packet packet) { + Socket::ResourceID rid = packet.Header().m_resourceID; + auto promise = TakePendingResponse(rid); + if (!promise) return; + + RemoteLockResponse resp; + if (resp.Read(packet.Body()) == nullptr) { + promise->set_value(ErrorCode::Fail); + return; + } + + promise->set_value(resp.m_status == RemoteLockResponse::Status::Granted + ? ErrorCode::Success : ErrorCode::Fail); + } + + // ---- Response matching helpers ---- + + std::pair, bool> CreatePendingResponse(Socket::ResourceID resID) { + std::promise promise; + auto future = promise.get_future(); + std::lock_guard lock(m_pendingMutex); + m_pendingResponses.emplace(resID, std::move(promise)); + return {std::move(future), true}; + } + + void ErasePending(Socket::ResourceID resID) { + std::lock_guard lock(m_pendingMutex); + m_pendingResponses.erase(resID); + } + + /// Take a pending promise out of the map (returns nullptr if not found). + std::unique_ptr> TakePendingResponse(Socket::ResourceID resID) { + std::lock_guard lock(m_pendingMutex); + auto it = m_pendingResponses.find(resID); + if (it == m_pendingResponses.end()) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: Response for unknown resourceID %u\n", resID); + return nullptr; + } + auto p = std::make_unique>(std::move(it->second)); + m_pendingResponses.erase(it); + return p; + } + + /// Create a send-failure callback that resolves the pending promise. + std::function MakeSendFailHandler(Socket::ResourceID resID) { + return [resID, this](bool success) { + if (!success) { + std::lock_guard lock(m_pendingMutex); + auto it = m_pendingResponses.find(resID); + if (it != m_pendingResponses.end()) { + it->second.set_value(ErrorCode::Fail); + m_pendingResponses.erase(it); + } + } + }; + } + + void SendAppendResponse(Socket::Packet& srcPacket, RemoteAppendResponse::Status status) { + RemoteAppendResponse resp; + resp.m_status = status; + + Socket::Packet ret; + ret.Header().m_packetType = Socket::PacketType::AppendResponse; + ret.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + ret.Header().m_connectionID = srcPacket.Header().m_connectionID; + ret.Header().m_resourceID = srcPacket.Header().m_resourceID; + + auto bodySize = static_cast(resp.EstimateBufferSize()); + ret.Header().m_bodyLength = bodySize; + ret.AllocateBuffer(bodySize); + resp.Write(ret.Body()); + ret.Header().WriteBuffer(ret.HeaderBuffer()); + + m_net->GetServer()->SendPacket(srcPacket.Header().m_connectionID, std::move(ret), nullptr); + } + + void SendBatchAppendResponse(Socket::Packet& srcPacket, + std::uint32_t successCount, std::uint32_t failCount) { + BatchRemoteAppendResponse resp; + resp.m_successCount = successCount; + resp.m_failCount = failCount; + + Socket::Packet ret; + ret.Header().m_packetType = Socket::PacketType::BatchAppendResponse; + ret.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + ret.Header().m_connectionID = srcPacket.Header().m_connectionID; + ret.Header().m_resourceID = srcPacket.Header().m_resourceID; + + auto bodySize = static_cast(resp.EstimateBufferSize()); + ret.Header().m_bodyLength = bodySize; + ret.AllocateBuffer(bodySize); + resp.Write(ret.Body()); + ret.Header().WriteBuffer(ret.HeaderBuffer()); + + m_net->GetServer()->SendPacket(srcPacket.Header().m_connectionID, std::move(ret), nullptr); + } + + // ================================================================== + // [Bug 26] Background executor — slow-lane for batch RPC handlers + // ================================================================== + // + // Why: the network server thread pool has only 8 threads + // (NetworkNode.h). HandleBatchAppendRequest does heavy TiKV work + // (fan out to 4 sub-workers and join), each call tying up its + // network thread for tens of seconds during inserts. + // Once 4–8 such handlers run concurrently, every network thread is + // blocked and latency-sensitive RPCs (HeadSync, RemoteLock) cannot be + // serviced. + // + // Fix: parse on the network thread (fast), then enqueue the heavy + // work onto a dedicated background thread pool and return. The + // network thread immediately becomes available for other RPCs. + // The background worker eventually sends the response itself. + // + // Sizing rationale: + // - Threads default to 8: matches the network pool so we never + // under-utilize CPU even if every network thread is parsing a + // batch. Tunable via env SPTAG_BG_EXEC_THREADS. + // - Queue cap default 256: plenty of headroom for typical bursts; + // when full, falls back to synchronous execution to preserve + // correctness rather than dropping requests. + + // Background executor removed: BatchAppend now runs as sub-Jobs on + // the searcher's shared compute pool via SetJobSubmitter() so it + // shares a single concurrency budget with local Split/Merge/Reassign + // (with high-priority jumping the queue). See HandleBatchAppendRequest. + + // ================================================================== + // HeadSync retry thread — periodic best-effort drain of per-peer + // backlogs that were populated by failed BroadcastHeadSync sends. + // + // Why: BroadcastHeadSync is fire-and-forget by design (we don't + // want to block the layer-1 split path on a slow peer). When the + // TCP send completion reports failure, we previously dropped the + // entries forever and the peer's headIndex / m_pSamples diverged, + // causing the receiver's BKTree to miss heads at search time and + // recall to collapse on later batches. The retry queue + this + // thread make HeadSync delivery reliable best-effort. + // ================================================================== + + struct HeadSyncBacklog { + std::mutex mu; + std::deque queue; + // Matches m_addCountForRebuild scale per peer. If we ever hit + // this we log + drop (fall back to manual reconcile). + static constexpr size_t kMaxEntries = 1u << 18; // 262144 + }; + + void StartHeadSyncRetryThread() { + const char* envIntervalMs = std::getenv("SPTAG_HEADSYNC_RETRY_INTERVAL_MS"); + int intervalMs = 500; + if (envIntervalMs) { + try { intervalMs = std::max(50, std::stoi(envIntervalMs)); } catch (...) {} + } + m_headSyncRetryIntervalMs = intervalMs; + m_headSyncRetryStop.store(false, std::memory_order_release); + m_headSyncRetryThread = std::thread([this]() { HeadSyncRetryLoop(); }); + } + + void StopHeadSyncRetryThread() { + m_headSyncRetryStop.store(true, std::memory_order_release); + if (m_headSyncRetryThread.joinable()) m_headSyncRetryThread.join(); + } + + void HeadSyncRetryLoop() { + using namespace std::chrono; + while (!m_headSyncRetryStop.load(std::memory_order_acquire)) { + std::this_thread::sleep_for(milliseconds(m_headSyncRetryIntervalMs)); + if (m_net) DrainHeadSyncBacklog(); + } + // Final drain pass to give the network a chance to flush. + for (int i = 0; i < 5 && m_net; i++) { + size_t dispatched = DrainHeadSyncBacklog(); + if (dispatched == 0) break; + std::this_thread::sleep_for(milliseconds(200)); + } + if (m_headSyncBroadcastEntries.load(std::memory_order_relaxed) > 0 + || m_headSyncRecvEntries.load(std::memory_order_relaxed) > 0) { + DumpHeadSyncStats("shutdown"); + } + if (m_mergeBroadcastSendOK.load(std::memory_order_relaxed) > 0 + || m_mergeRecvHints.load(std::memory_order_relaxed) > 0) { + DumpMergeRequestStats("shutdown"); + } + } + + std::shared_ptr GetOrCreateBacklog(int nodeIdx) { + { + std::shared_lock lk(m_headSyncBacklogsMu); + auto it = m_headSyncBacklogs.find(nodeIdx); + if (it != m_headSyncBacklogs.end()) return it->second; + } + std::unique_lock lk(m_headSyncBacklogsMu); + auto& slot = m_headSyncBacklogs[nodeIdx]; + if (!slot) slot = std::make_shared(); + return slot; + } + + // ---- State ---- + + NetworkAccess* m_net = nullptr; + + // Per-layer callback registries. Indexed by ExtraDynamicSearcher layer + // (m_layer at the call site). Resized lazily by SetXxxCallback. The + // empty/null entry at layer 0 is preserved so a single-layer caller + // (legacy or test) without explicit Set keeps the no-op default. + // + // The shared-callback design existed because the original SPANN had + // a single ExtraDynamicSearcher (Layers=1). With Layers>=2, each + // layer's lambda captures its own `this` (hence m_layer) and dispatch + // by request.m_layer is required to avoid routing layer-0 events to + // layer-1's storage and vice versa. + std::vector m_appendCallbacks; + std::vector m_headSyncCallbacks; + std::vector m_remoteLockCallbacks; + std::vector m_mergeCallbacks; + + // Per-layer ownership tokens. Each ExtraDynamicSearcher claims its + // layer slot at SetWorker time and releases it on destruction; this + // prevents earlier-layer destructors from wiping a later-layer's + // callbacks (the original ClaimCallbackOwnership purpose, now + // applied per-layer instead of globally). + std::vector> m_callbackOwners; + + // Guards the lifetime of the captured `this` inside the callbacks. + // Held in shared mode by every callback invocation site, and in + // exclusive mode by ClearCallbacks() / SetXxxCallback() so that + // (re)assigning a callback can never race with an in-flight invocation. + mutable std::shared_timed_mutex m_callbackLifetimeMutex; + + std::atomic m_nextResourceId{1}; + std::mutex m_pendingMutex; + std::unordered_map> m_pendingResponses; + + // Per-item Job: each remote append request becomes one Job submitted + // to the searcher's shared SPDKThreadPool. The last completing Job + // ACKs the sender. Identical to how a local insert thread would call + // Append; the only difference is the request originated on a peer. + class BatchAppendItemJob : public Helper::ThreadPool::Job { + public: + BatchAppendItemJob(RemotePostingOps* ops, + std::shared_ptr batchReq, + size_t index, + std::shared_ptr> remaining, + std::shared_ptr> successCount, + std::shared_ptr> failCount, + std::shared_ptr replyPacket) + : m_ops(ops), m_batchReq(std::move(batchReq)), m_index(index), + m_remaining(std::move(remaining)), + m_success(std::move(successCount)), + m_fail(std::move(failCount)), + m_replyPacket(std::move(replyPacket)) {} + + void exec(IAbortOperation*) override { run(); } + void exec(void* workspace, IAbortOperation*) override { + void* prev = tls_preallocAppendWorkSpace; + tls_preallocAppendWorkSpace = workspace; + run(); + tls_preallocAppendWorkSpace = prev; + } + + private: + void run() { + { + std::shared_lock cbLock(m_ops->m_callbackLifetimeMutex); + auto& req = m_batchReq->m_items[m_index]; + ErrorCode r = ErrorCode::Fail; + const auto* cb = m_ops->LookupAppendCallback_Locked(req.m_layer); + if (cb) { + auto hv = std::make_shared(std::move(req.m_headVec)); + r = (*cb)(req.m_headID, hv, req.m_appendNum, req.m_appendPosting); + } + if (r == ErrorCode::Success) m_success->fetch_add(1); + else m_fail->fetch_add(1); + } + if (m_remaining->fetch_sub(1) == 1) { + m_ops->SendBatchAppendResponse( + *m_replyPacket, m_success->load(), m_fail->load()); + } + } + + RemotePostingOps* m_ops; + std::shared_ptr m_batchReq; + size_t m_index; + std::shared_ptr> m_remaining; + std::shared_ptr> m_success; + std::shared_ptr> m_fail; + std::shared_ptr m_replyPacket; + }; + + // [Bug 26 retired] bg executor removed — see HandleBatchAppendRequest. + // m_bgWorkers etc were replaced by per-layer job submission into the + // searcher's shared SPDKThreadPool via m_jobSubmitters[layer]. + std::vector m_jobSubmitters; + + // HeadSync delivery diagnostics + retry queue (v33). Counters give + // observability for sender/receiver gaps; per-peer backlogs + + // retry thread make broadcast reliable best-effort. + std::atomic m_headSyncBroadcastEntries{0}; + std::atomic m_headSyncBroadcastSendOK{0}; + std::atomic m_headSyncBroadcastSendFail{0}; + std::atomic m_headSyncRecvEntries{0}; + std::atomic m_headSyncApplyAdd{0}; + std::atomic m_headSyncApplyDelete{0}; + std::atomic m_headSyncRetryEnqueued{0}; + std::atomic m_headSyncRetrySucceeded{0}; + std::atomic m_headSyncRetryDropped{0}; + + // Cross-node merge hint counters. No retry queue: dropped + // notifications are recoverable since the owner discovers underfull + // postings via its own paths too. + std::atomic m_mergeBroadcastSendOK{0}; + std::atomic m_mergeBroadcastSendFail{0}; + std::atomic m_mergeRecvHints{0}; + std::atomic m_mergeRecvDropped{0}; + + mutable std::shared_timed_mutex m_headSyncBacklogsMu; + std::unordered_map> m_headSyncBacklogs; + std::thread m_headSyncRetryThread; + std::atomic m_headSyncRetryStop{false}; + int m_headSyncRetryIntervalMs{500}; + }; + +} // namespace SPTAG::SPANN diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h new file mode 100644 index 000000000..8af906fcc --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -0,0 +1,616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef _SPTAG_SPANN_WORKERNODE_H_ +#define _SPTAG_SPANN_WORKERNODE_H_ + +#include "inc/Core/SPANN/Distributed/NetworkNode.h" +#include "inc/Helper/KeyValueIO.h" +#include "inc/Helper/CommonHelper.h" +#include "inc/Socket/SimpleSerialization.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace SPTAG::SPANN { + + /// Distributed compute worker node. + /// + /// Responsibilities: + /// - Route headIDs to owner nodes via consistent hash ring + /// - Queue and flush remote appends (batched RPC) + /// - HeadSync broadcast and remote locking + /// - Register with dispatcher and receive ring updates + /// - Handle incoming dispatch commands from the driver + class WorkerNode : public NetworkNode { + public: + using AppendCallback = RemotePostingOps::AppendCallback; + using DispatchCallback = DispatchCoordinator::DispatchCallback; + using HeadSyncCallback = RemotePostingOps::HeadSyncCallback; + using RemoteLockCallback = RemotePostingOps::RemoteLockCallback; + + /// Initialize with separate dispatcher/worker/store addresses. + /// workerIndex is 0-based (0 = driver/local, 1+ = remote). + /// Internal node index = workerIndex + 1 (0 is reserved for dispatcher). + bool Initialize( + std::shared_ptr p_db, + int workerIndex, + const std::pair& dispatcherAddr, + const std::vector>& workerAddrs, + const std::vector& storeAddrs, + int vnodeCount = 150) + { + if (storeAddrs.empty()) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "WorkerNode::Initialize: storeAddrs is empty\n"); + return false; + } + + // Build combined addr list: [dispatcher, worker0, worker1, ...] + std::vector> allAddrs; + allAddrs.push_back(dispatcherAddr); + allAddrs.insert(allAddrs.end(), workerAddrs.begin(), workerAddrs.end()); + + int internalIdx = workerIndex + 1; // 0 = dispatcher, 1..N = workers + if (!InitializeNetwork(internalIdx, allAddrs, vnodeCount)) return false; + + // [Bug 30] Populate compute-role fields so callers can ask + // "how many data shards?" / "which shard am I?" without + // accidentally including the dispatcher slot. + m_numDispatchNodes = 1; + m_numWorkerNodes = static_cast(workerAddrs.size()); + m_workerNodeIndex = workerIndex; + + m_db = p_db; + m_nodeStores = storeAddrs; + + // Build store → node list mapping (worker internal indices 1..N) + int numWorkers = static_cast(workerAddrs.size()); + int numStores = static_cast(storeAddrs.size()); + for (int wi = 0; wi < numWorkers; wi++) { + int storeIdx = wi % numStores; + m_storeToNodes[storeAddrs[storeIdx]].push_back(wi + 1); + } + for (auto& [store, nodes] : m_storeToNodes) { + std::string nodeList; + for (int n : nodes) { nodeList += std::to_string(n) + " "; } + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "WorkerNode: store %s → nodes [%s]\n", store.c_str(), nodeList.c_str()); + } + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "WorkerNode: initialized (workerIndex=%d, internalIdx=%d, %d stores, %d vnodes/node)\n", + workerIndex, internalIdx, numStores, vnodeCount); + + m_dispatch.SetNetwork(this); + m_remoteOps.SetNetwork(this); + + return true; + } + + public: + bool Start() { return StartNetwork(); } + + // ---- Callbacks ---- + // + // ExtraDynamicSearcher passes its m_layer when binding callbacks so + // that with multi-layer SPANN (Layers >= 2) each layer has its own + // captured `this` and request dispatch on the receiver side routes by + // request.m_layer. + + void SetAppendCallback(int layer, AppendCallback cb) { m_remoteOps.SetAppendCallback(layer, std::move(cb)); } + void SetHeadSyncCallback(int layer, HeadSyncCallback cb) { m_remoteOps.SetHeadSyncCallback(layer, std::move(cb)); } + void SetRemoteLockCallback(int layer, RemoteLockCallback cb) { m_remoteOps.SetRemoteLockCallback(layer, std::move(cb)); } + // Inject the searcher's shared compute pool so receiver-side + // BatchAppend work runs there (high-priority Jobs) instead of in a + // separate executor. Idempotent: safe to call multiple times. + void SetJobSubmitter(int layer, RemotePostingOps::JobSubmitter s) { + m_remoteOps.SetJobSubmitter(layer, std::move(s)); + } + /// Atomically clear all RPC callbacks (every layer) and wait for any + /// in-flight invocation to finish. + void ClearCallbacks() { + m_remoteOps.ClearCallbacks(); + } + /// Per-layer ownership API used by ExtraDynamicSearcher to avoid having + /// one layer's destructor wipe another layer's still-active callbacks. + /// SetWorker calls ClaimCallbackOwnership(m_layer, this) before + /// registering; the destructor calls ClearCallbacksIfOwner(m_layer, this). + void ClaimCallbackOwnership(int layer, const void* owner) { + m_remoteOps.ClaimCallbackOwnership(layer, owner); + } + bool ClearCallbacksIfOwner(int layer, const void* owner) { + return m_remoteOps.ClearCallbacksIfOwner(layer, owner); + } + void SetDispatchCallback(DispatchCallback cb) { m_dispatch.SetDispatchCallback(std::move(cb)); } + void ClearDispatchCallback() { m_dispatch.ClearDispatchCallback(); } + + // ---- Routing ---- + + RouteTarget GetOwner(SizeType headID) { + RouteTarget target; + target.isLocal = true; + target.nodeIndex = m_localNodeIndex; + + if (!m_enabled) { + m_routeStats.disabled++; + return target; + } + { + auto ring = std::atomic_load(&m_hashRing); + if (!ring || ring->NodeCount() <= 1) { + m_routeStats.local++; + return target; + } + target.nodeIndex = ring->GetOwner(headID); + } + target.isLocal = (target.nodeIndex == m_localNodeIndex); + if (target.isLocal) m_routeStats.local++; + else m_routeStats.remote++; + return target; + } + + void LogRouteStats(const char* context = "") { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "WorkerNode stats%s: local=%d remote=%d disabled=%d keyMiss=%d noMapping=%d\n", + context, (int)m_routeStats.local, (int)m_routeStats.remote, + (int)m_routeStats.disabled, (int)m_routeStats.keyMiss, + (int)m_routeStats.noMapping); + } + + void ResetRouteStats() { + m_routeStats.local.store(0); + m_routeStats.remote.store(0); + m_routeStats.disabled.store(0); + m_routeStats.keyMiss.store(0); + m_routeStats.noMapping.store(0); + } + + // ---- Remote posting ops ---- + + ErrorCode SendRemoteAppend(int targetNodeIndex, int layer, SizeType headID, + const std::shared_ptr& headVec, int appendNum, + std::string& appendPosting) + { + return m_remoteOps.SendRemoteAppend(targetNodeIndex, layer, headID, headVec, appendNum, appendPosting); + } + + ErrorCode SendBatchRemoteAppend(int targetNodeIndex, std::vector& items) { + return m_remoteOps.SendBatchRemoteAppend(targetNodeIndex, items); + } + + void BroadcastHeadSync(const std::vector& entries) { + if (!m_enabled) return; + m_remoteOps.BroadcastHeadSync(entries); + } + + // v33: expose HeadSync delivery diagnostics + retry queue. + void DumpHeadSyncStats(const char* label) const { + m_remoteOps.DumpHeadSyncStats(label); + } + // Cross-node merge-hint channel diagnostics. + void DumpMergeRequestStats(const char* label) const { + m_remoteOps.DumpMergeRequestStats(label); + } + size_t GetHeadSyncBacklogSize() const { + return m_remoteOps.GetHeadSyncBacklogSize(); + } + size_t DrainHeadSyncBacklog(size_t maxBatch = 1024) { + return m_remoteOps.DrainHeadSyncBacklog(maxBatch); + } + void NoteHeadSyncApplyAdd() { + m_remoteOps.NoteHeadSyncApplyAdd(); + } + void NoteHeadSyncApplyDelete() { + m_remoteOps.NoteHeadSyncApplyDelete(); + } + + bool SendRemoteLock(int nodeIndex, int layer, SizeType headID, bool lock) { + if (!m_enabled) return false; + return m_remoteOps.SendRemoteLock(nodeIndex, layer, headID, lock); + } + + void SetMergeCallback(int layer, RemotePostingOps::MergeCallback cb) { + m_remoteOps.SetMergeCallback(layer, std::move(cb)); + } + + // ---- Append queue ---- + + void QueueRemoteAppend(int nodeIndex, RemoteAppendRequest req) { + std::vector toFlush; + bool didReserveSlot = false; + { + std::lock_guard lock(m_appendQueueMutex); + auto& q = m_appendQueue[nodeIndex]; + q.push_back(std::move(req)); + m_remoteQueueSize.fetch_add(1, std::memory_order_relaxed); + // [PERF] Auto-flush per node once we have a full chunk worth + // (kAutoFlushThreshold items). Without this, every remote + // append accumulates until end-of-batch FlushRemoteAppends — + // which then sends hundreds of thousands of items serially + // (10k chunks * ~3s/chunk) AFTER all insert compute is done. + // Auto-flushing while inserts keep running overlaps the + // network with CPU and drops end-of-batch tail latency. + // + // [v38] Allow up to kMaxInflightPerNode concurrent in-flight + // chunks per node so a producer burst (split fan-out, reassign + // wave) can saturate the receiver's bg-executor pool instead of + // queueing up serially behind a single per-node mutex. + if (q.size() >= kAutoFlushThreshold + && m_perNodeInflight[nodeIndex] < kMaxInflightPerNode) { + toFlush.swap(q); + m_remoteQueueSize.fetch_sub(toFlush.size(), std::memory_order_relaxed); + ++m_perNodeInflight[nodeIndex]; + didReserveSlot = true; + } + } + if (!didReserveSlot) return; + + // Fire-and-forget async send. After the initial chunk completes, + // the same thread loops to pick up any further accumulation so we + // avoid thread-spawn churn while keeping per-node concurrency at + // kMaxInflightPerNode. Order across batches is best-effort: the + // receiver runs 8 worker threads on each chunk that already + // interleave items within a chunk, so cross-chunk ordering adds + // no extra correctness risk for the per-posting RMW path. + auto items = std::make_shared>(std::move(toFlush)); + m_inflightAppendFlushes.fetch_add(1, std::memory_order_relaxed); + std::thread([this, nodeIndex, items]() { + while (true) { + ErrorCode ret = SendBatchRemoteAppend(nodeIndex, *items); + if (ret != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "QueueRemoteAppend auto-flush: batch to node %d failed (%zu items)\n", + nodeIndex, items->size()); + } + items->clear(); + { + std::lock_guard lock(m_appendQueueMutex); + auto it = m_appendQueue.find(nodeIndex); + if (it == m_appendQueue.end() + || it->second.size() < kAutoFlushThreshold) { + --m_perNodeInflight[nodeIndex]; + break; + } + items->swap(it->second); + m_remoteQueueSize.fetch_sub(items->size(), + std::memory_order_relaxed); + } + } + m_inflightAppendFlushes.fetch_sub(1, std::memory_order_relaxed); + }).detach(); + } + + size_t GetRemoteQueueSize() const { + return m_remoteQueueSize.load(std::memory_order_relaxed); + } + + ErrorCode FlushRemoteAppends() { + // Drain the queue under m_flushMutex so concurrent flush callers + // serialize. Loop in case items get queued mid-send. This avoids + // the thundering-herd of 100+ concurrent FlushRemoteAppends calls + // (one per split worker) overwhelming the remote node's tiny + // (8-thread, 256-connection-pool) network server. + std::lock_guard flushGuard(m_flushMutex); + + // Wait for any in-flight async auto-flushes triggered by + // QueueRemoteAppend (>= kAutoFlushThreshold) to drain so the + // residue we send below is the actual tail. Callers invoke + // FlushRemoteAppends after all producers (AddIndex / split / + // reassign) have quiesced, so no new auto-flushes will start + // here. + while (m_inflightAppendFlushes.load(std::memory_order_relaxed) > 0) { + std::this_thread::sleep_for(std::chrono::milliseconds(20)); + } + + int errors = 0; + int iterations = 0; + while (true) { + std::unordered_map> toSend; + { + std::lock_guard lock(m_appendQueueMutex); + if (m_appendQueue.empty()) break; + toSend.swap(m_appendQueue); + m_remoteQueueSize.store(0, std::memory_order_relaxed); + } + if (toSend.empty()) break; + ++iterations; + + std::atomic iterErrors{0}; + std::vector threads; + for (auto& [nodeIdx, items] : toSend) { + if (items.empty()) continue; + threads.emplace_back([this, &iterErrors, nodeIdx, &items]() { + // Per-node mutex serializes against any straggler + // auto-flush still in flight for this node. + std::mutex& nodeMtx = GetPerNodeAppendFlushMutex(nodeIdx); + std::lock_guard nlock(nodeMtx); + ErrorCode ret = SendBatchRemoteAppend(nodeIdx, items); + if (ret != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "FlushRemoteAppends: batch to node %d failed (%d items)\n", + nodeIdx, (int)items.size()); + iterErrors++; + } + }); + } + for (auto& t : threads) t.join(); + errors += iterErrors.load(); + } + return errors > 0 ? ErrorCode::Fail : ErrorCode::Success; + } + + // ---- Cross-node merge hint queue ---- + // + // Search-side fire-and-forget notifications: node X sees posting H + // underfull, where H is owned by Y. We dedup (layer, headID) within + // a flush window and batch-send to Y in one packet. The receiver's + // m_mergeList dedups on top of this, so an occasional dropped or + // duplicated notification only costs a few cycles. + void QueueRemoteMerge(int nodeIndex, int layer, SizeType headID) { + std::vector toFlush; + { + std::lock_guard lock(m_mergeQueueMutex); + std::int64_t key = (static_cast(layer) << 32) + | static_cast(headID); + auto& bucket = m_mergeQueue[nodeIndex]; + if (!bucket.insert(key).second) return; // already pending + m_mergeQueueSize.fetch_add(1, std::memory_order_relaxed); + + if (bucket.size() >= kMergeAutoFlushThreshold) { + toFlush.reserve(bucket.size()); + for (std::int64_t k : bucket) { + RemoteMergeRequest req; + req.m_layer = static_cast(k >> 32); + req.m_headID = static_cast(static_cast(k & 0xFFFFFFFF)); + toFlush.push_back(std::move(req)); + } + m_mergeQueueSize.fetch_sub(bucket.size(), std::memory_order_relaxed); + bucket.clear(); + } + } + if (!toFlush.empty()) { + m_remoteOps.SendBatchRemoteMerge(nodeIndex, toFlush); + } + } + + ErrorCode FlushRemoteMerges() { + std::unordered_map> toSend; + { + std::lock_guard lock(m_mergeQueueMutex); + if (m_mergeQueue.empty()) return ErrorCode::Success; + for (auto& [nodeIdx, bucket] : m_mergeQueue) { + auto& vec = toSend[nodeIdx]; + vec.reserve(bucket.size()); + for (std::int64_t k : bucket) { + RemoteMergeRequest req; + req.m_layer = static_cast(k >> 32); + req.m_headID = static_cast(static_cast(k & 0xFFFFFFFF)); + vec.push_back(std::move(req)); + } + } + m_mergeQueue.clear(); + m_mergeQueueSize.store(0, std::memory_order_relaxed); + } + for (auto& [nodeIdx, items] : toSend) { + if (!items.empty()) m_remoteOps.SendBatchRemoteMerge(nodeIdx, items); + } + return ErrorCode::Success; + } + + // ---- Ring protocol (worker side) ---- + + bool WaitForRing(int timeoutSec = 120) { + auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(timeoutSec); + while (std::chrono::steady_clock::now() < deadline) { + auto ring = std::atomic_load(&m_hashRing); + if (ring && ring->NodeCount() > 0) return true; + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "WorkerNode: Timed out waiting for ring (%ds)\n", timeoutSec); + return false; + } + + // ---- Data members (public for ExtraDynamicSearcher access) ---- + + std::shared_ptr m_db; + std::vector m_nodeStores; + std::unordered_map> m_storeToNodes; + + struct RouteStats { + std::atomic local{0}; + std::atomic remote{0}; + std::atomic disabled{0}; + std::atomic keyMiss{0}; + std::atomic noMapping{0}; + } m_routeStats; + + protected: + void RegisterServerHandlers(Socket::PacketHandlerMapPtr& handlers) override { + handlers->emplace(Socket::PacketType::AppendRequest, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleAppendRequest(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::BatchAppendRequest, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleBatchAppendRequest(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::HeadSyncRequest, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleHeadSyncRequest(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::RemoteLockRequest, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleRemoteLockRequest(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::MergeRequest, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleMergeRequest(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::DispatchCommand, + [this](Socket::ConnectionID c, Socket::Packet p) { m_dispatch.HandleDispatchCommand(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::DispatchResult, + [this](Socket::ConnectionID c, Socket::Packet p) { m_dispatch.HandleDispatchResult(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::RingUpdate, + [this](Socket::ConnectionID c, Socket::Packet p) { HandleRingUpdate(c, std::move(p)); }); + } + + void RegisterClientHandlers(Socket::PacketHandlerMapPtr& handlers) override { + handlers->emplace(Socket::PacketType::AppendResponse, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleAppendResponse(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::BatchAppendResponse, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleBatchAppendResponse(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::RemoteLockResponse, + [this](Socket::ConnectionID c, Socket::Packet p) { m_remoteOps.HandleRemoteLockResponse(c, std::move(p)); }); + handlers->emplace(Socket::PacketType::DispatchResult, + [this](Socket::ConnectionID c, Socket::Packet p) { m_dispatch.HandleDispatchResult(c, std::move(p)); }); + } + + void BgProtocolStep() override { + // Keep sending NodeRegister until ring is populated + auto ring = std::atomic_load(&m_hashRing); + if (!ring || ring->NodeCount() == 0) { + Socket::ConnectionID connID = Socket::c_invalidConnectionID; + { + std::lock_guard lock(m_connMutex); + if (m_dispatcherNodeIndex < (int)m_peerConnections.size()) + connID = m_peerConnections[m_dispatcherNodeIndex]; + } + if (connID != Socket::c_invalidConnectionID) { + SendNodeRegister(); + } + } + } + + bool IsRingSettled() const override { + auto ring = std::atomic_load(&m_hashRing); + return ring && ring->NodeCount() > 0; + } + + private: + void SendNodeRegister() { + NodeRegisterMsg msg; + msg.m_nodeIndex = m_localNodeIndex; + msg.m_host = m_nodeAddrs[m_localNodeIndex].first; + msg.m_port = m_nodeAddrs[m_localNodeIndex].second; + // Worker's 0-based index = m_localNodeIndex - 1 (since 0 is dispatcher) + int workerIdx = m_localNodeIndex - 1; + int numStores = static_cast(m_nodeStores.size()); + msg.m_store = (numStores > 0) ? m_nodeStores[workerIdx % numStores] : ""; + + std::size_t bodySize = msg.EstimateBufferSize(); + Socket::Packet pkt; + pkt.Header().m_packetType = Socket::PacketType::NodeRegisterRequest; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + pkt.Header().m_bodyLength = static_cast(bodySize); + pkt.AllocateBuffer(static_cast(bodySize)); + msg.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + auto connID = GetPeerConnection(m_dispatcherNodeIndex); + if (connID != Socket::c_invalidConnectionID) { + m_client->SendPacket(connID, std::move(pkt), nullptr); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "WorkerNode: Sent NodeRegister (node %d) to dispatcher\n", m_localNodeIndex); + } + } + + void HandleRingUpdate(Socket::ConnectionID connID, Socket::Packet packet) { + RingUpdateMsg msg; + if (!msg.Read(packet.Body())) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "WorkerNode: Failed to parse RingUpdate\n"); + return; + } + + auto newRing = std::make_shared(msg.m_vnodeCount); + for (auto idx : msg.m_nodeIndices) { + newRing->AddNode(idx); + } + { + std::lock_guard guard(m_ringWriteMutex); + std::atomic_store(&m_hashRing, + std::shared_ptr(std::move(newRing))); + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "WorkerNode: Ring updated — %d nodes (v%u)\n", + (int)msg.m_nodeIndices.size(), msg.m_ringVersion); + + SendRingUpdateACK(msg.m_ringVersion); + } + + void SendRingUpdateACK(std::uint32_t ringVersion) { + RingUpdateACKMsg msg; + msg.m_nodeIndex = m_localNodeIndex; + msg.m_ringVersion = ringVersion; + + std::size_t bodySize = msg.EstimateBufferSize(); + Socket::Packet pkt; + pkt.Header().m_packetType = Socket::PacketType::RingUpdateACK; + pkt.Header().m_processStatus = Socket::PacketProcessStatus::Ok; + pkt.Header().m_connectionID = Socket::c_invalidConnectionID; + pkt.Header().m_resourceID = 0; + pkt.Header().m_bodyLength = static_cast(bodySize); + pkt.AllocateBuffer(static_cast(bodySize)); + msg.Write(pkt.Body()); + pkt.Header().WriteBuffer(pkt.HeaderBuffer()); + + auto connID = GetPeerConnection(m_dispatcherNodeIndex); + if (connID != Socket::c_invalidConnectionID) { + m_client->SendPacket(connID, std::move(pkt), nullptr); + } + } + + int m_dispatcherNodeIndex = 0; + RemotePostingOps m_remoteOps; + DispatchCoordinator m_dispatch; + + mutable std::mutex m_appendQueueMutex; + std::unordered_map> m_appendQueue; + std::atomic m_remoteQueueSize{0}; + // Serializes concurrent FlushRemoteAppends() callers so we don't open + // hundreds of simultaneous RPC streams to the remote worker (which has + // only 8 server threads / 256 connection slots). With this mutex, only + // one thread sends at a time; concurrent callers either wait for the + // current flush to finish or contribute their items to the queue. + std::mutex m_flushMutex; + + // Per-node mutex used by end-of-batch FlushRemoteAppends so concurrent + // sends to the SAME node from the final-drain path remain ordered. + // Auto-flushes (QueueRemoteAppend) instead use m_perNodeInflight to + // cap concurrency at kMaxInflightPerNode per node. + std::mutex m_perNodeAppendFlushMutexMapLock; + std::unordered_map> m_perNodeAppendFlushMutex; + std::atomic m_inflightAppendFlushes{0}; + std::unordered_map m_perNodeInflight; // guarded by m_appendQueueMutex + static constexpr size_t kAutoFlushThreshold = 50000; + static constexpr int kMaxInflightPerNode = 4; + + std::mutex& GetPerNodeAppendFlushMutex(int nodeIndex) { + std::lock_guard lk(m_perNodeAppendFlushMutexMapLock); + auto it = m_perNodeAppendFlushMutex.find(nodeIndex); + if (it == m_perNodeAppendFlushMutex.end()) { + auto ins = m_perNodeAppendFlushMutex.emplace( + nodeIndex, std::make_unique()); + return *ins.first->second; + } + return *it->second; + } + + // Cross-node merge hint queue. Per-target dedup set of packed + // (layer << 32 | headID) values; QueueRemoteMerge inserts and + // auto-flushes when the per-target bucket reaches threshold. + mutable std::mutex m_mergeQueueMutex; + std::unordered_map> m_mergeQueue; + std::atomic m_mergeQueueSize{0}; + // Merge hints are non-urgent (best-effort optimization). A larger + // bucket trades a small amount of latency for much better dedup and + // network batching. End-of-batch FlushRemoteMerges() guarantees no + // hint is permanently dropped. + static constexpr size_t kMergeAutoFlushThreshold = 8192; + }; + +} // namespace SPTAG::SPANN + +#endif // _SPTAG_SPANN_WORKERNODE_H_ diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index fe3d306a1..29129bdb4 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -19,6 +19,7 @@ #include "inc/Core/Common/LocalVersionMap.h" #include "inc/Core/Common/TiKVVersionMap.h" #include "ExtraFileController.h" +#include "Distributed/WorkerNode.h" #include #include #include @@ -207,15 +208,29 @@ namespace SPTAG::SPANN { }; private: + std::atomic m_workspaceCount = 0; + std::shared_ptr db; + WorkerNode* m_worker = nullptr; // externally owned, set via SetWorker() + + public: + // Expose the underlying KV handle so a standalone WorkerNode can be wired to the + // same DB this searcher already opened, instead of opening a second one. + std::shared_ptr GetDB() const { return db; } + private: SPANN::Index* m_headIndex; std::unique_ptr m_versionMap; Options* m_opt; int m_layer; + SizeType m_initialVectorSize = 0; // vector count at build time (before inserts) COMMON::FineGrainedRWLock m_rwLocks; + // Per-bucket flags for remote (cross-node) locking. + static constexpr int kRemoteLockPoolSize = 32767; + std::unique_ptr[]> m_remoteBucketLocked; + IndexStats m_stat; std::shared_ptr m_wal; @@ -339,9 +354,247 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Posting size limit: %d, search limit: %f, merge threshold: %d\n", m_postingSizeLimit, p_opt.m_latencyLimit, m_mergeThreshold); SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "[CONFIG] layer=%d DistributedVersionMap=%s SearchCheckVersionMapOnlyLayer0=%s UseMultiChunkPosting=%s PostingPageLimit=%d\n", layer, p_opt.m_distributedVersionMap ? "true" : "false", p_opt.m_searchCheckVersionMapOnlyLayer0 ? "true" : "false", p_opt.m_useMultiChunkPosting ? "true" : "false", p_opt.m_postingPageLimit); + + // Initialize per-bucket remote lock flags + m_remoteBucketLocked.reset(new std::atomic[kRemoteLockPoolSize + 1]{}); + } + + ~ExtraDynamicSearcher() { + if (m_worker) { + m_worker->ClearCallbacksIfOwner(m_layer, this); + m_worker = nullptr; + } + } + + int GetNumWorkerNodes() const { + if (m_worker && m_worker->IsEnabled()) { + return std::max(1, m_worker->GetNumWorkerNodes()); + } + return 1; + } + + int GetWorkerNodeIndex() const { + if (m_worker && m_worker->IsEnabled()) { + int idx = m_worker->GetWorkerNodeIndex(); + return idx >= 0 ? idx : 0; + } + return 0; + } + + // Stripe globalVID across worker nodes (only for vectors added after build). + SizeType AllocateGlobalVID(SizeType localVID) const override { + int numWorkers = GetNumWorkerNodes(); + if (numWorkers <= 1 || localVID < m_initialVectorSize) return localVID; + return m_initialVectorSize + (localVID - m_initialVectorSize) * numWorkers + GetWorkerNodeIndex(); + } + + // Idempotent: wires the receiver's BatchAppend Jobs onto our shared + // SPDKThreadPool. Called both after pool creation and from + // SetWorker(); whichever happens last actually binds the submitter. + void WireJobSubmitterIfReady() { + if (!m_worker || !m_splitThreadPool) return; + auto pool = m_splitThreadPool; + m_worker->SetJobSubmitter(m_layer, + [pool](Helper::ThreadPool::Job* j, bool high) { + if (high) pool->add_high(j); + else pool->add(j); + }); + } + + /// Set the external WorkerNode pointer and bind all callbacks + /// (append, head-sync, remote-lock, merge-hint) at THIS instance's m_layer. + void SetWorker(WorkerNode* router) override { + m_worker = router; + if (!m_worker) return; + + WireJobSubmitterIfReady(); + + // Claim ownership so the matching destructor's IfOwner check + // clears the right slot if/when we are deleted (multi-layer SPANN + // each layer has its own slot keyed by m_layer). + m_worker->ClaimCallbackOwnership(m_layer, this); + + // Append callback: routes incoming remote appends to local Append() + m_worker->SetAppendCallback(m_layer, + [this](SizeType headID, std::shared_ptr headVec, + int appendNum, std::string& appendPosting) -> ErrorCode { + // Reuse SPDKThreadPool's per-worker pre-allocated workspace + // when called from BatchAppendItemJob on m_splitThreadPool. + ExtraWorkSpace localWorkSpace; + ExtraWorkSpace* ws = static_cast(tls_preallocAppendWorkSpace); + if (!ws) { + m_headIndex->InitWorkSpace(&localWorkSpace); + ws = &localWorkSpace; + } + bool wasMissing = !m_headIndex->ContainSample(headID, m_layer + 1); + if (wasMissing && headVec && !headVec->empty()) { + DimensionType dim = static_cast( + headVec->size() / sizeof(ValueType)); + m_headIndex->AddHeadIndex(headVec->data(), headID, 0, + dim, m_layer + 1, ws); + } + + // Mirror sender's version map for the records we're about + // to persist so MergePostings + SearchIndex don't drop + // them as "stale". See HEAD git history for rationale. + { + const uint8_t* basePtr = reinterpret_cast(appendPosting.data()); + size_t totalRec = appendPosting.size() / m_vectorInfoSize; + EnsureVersionMapCoversPosting(basePtr, totalRec, "AppendCallback", headID); + + const SizeType localCount = m_versionMap->Count(); + std::vector batchVids; + std::vector batchVers; + batchVids.reserve(totalRec); + batchVers.reserve(totalRec); + for (size_t i = 0; i < totalRec; ++i) { + const uint8_t* p = basePtr + i * m_vectorInfoSize; + SizeType vid = *reinterpret_cast(p); + uint8_t recVer = *(p + sizeof(SizeType)); + if (vid < 0 || vid >= localCount) continue; + if (recVer == 0xfe) continue; + uint8_t curVer = m_versionMap->GetVersion(vid); + if (curVer == 0xfe) continue; + if (curVer == recVer) continue; + batchVids.push_back(vid); + batchVers.push_back(recVer); + } + if (!batchVids.empty()) { + m_versionMap->SetVersionBatch(batchVids, batchVers); + } + } + return Append(ws, headID, appendNum, appendPosting, 0); + }); + + // Head sync callback: apply head index updates from peers + auto* headIndex = m_headIndex; + int layer = m_layer; + auto* worker = m_worker; + m_worker->SetHeadSyncCallback(m_layer, [headIndex, layer, worker](const HeadSyncEntry& entry) { + if (entry.op == HeadSyncEntry::Op::Add) { + headIndex->AddHeadIndex(entry.headVector.data(), entry.headVID, 0, + static_cast(entry.headVector.size() / sizeof(ValueType)), + layer + 1, nullptr); + if (worker) worker->NoteHeadSyncApplyAdd(); + } else { + headIndex->DeleteIndex(entry.headVID, layer + 1); + if (worker) worker->NoteHeadSyncApplyDelete(); + } + }); + + // Remote lock callback: per-bucket atomic flags + m_worker->SetRemoteLockCallback(m_layer, [this](SizeType headID, bool lock) -> bool { + unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex(static_cast(headID)); + if (lock) { + bool expected = false; + if (!m_remoteBucketLocked[bucket].compare_exchange_strong(expected, true)) { + return false; + } + if (!m_rwLocks[headID].try_lock()) { + m_remoteBucketLocked[bucket].store(false); + return false; + } + m_rwLocks[headID].unlock(); + return true; + } else { + m_remoteBucketLocked[bucket].store(false); + return true; + } + }); + + // Cross-node merge hint callback + m_worker->SetMergeCallback(m_layer, [this](SizeType headID) { + MergeAsync(headID); + }); + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "WorkerNode bound to ExtraDynamicSearcher (layer %d)\n", m_layer); } - ~ExtraDynamicSearcher() {} + // Owner-side wait for any in-flight remote lock on this bucket. + void WaitForRemoteBucketUnlocked(SizeType headID) const { + if (!m_worker || !m_worker->IsEnabled()) return; + unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex(static_cast(headID)); + if (!m_remoteBucketLocked[bucket].load(std::memory_order_acquire)) return; + constexpr int kMaxRemoteBucketWaitMs = 5000; + auto deadline = std::chrono::steady_clock::now() + + std::chrono::milliseconds(kMaxRemoteBucketWaitMs); + while (m_remoteBucketLocked[bucket].load(std::memory_order_acquire)) { + if (std::chrono::steady_clock::now() > deadline) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "WaitForRemoteBucketUnlocked: headID=%lld bucket=%u stuck for %d ms, proceeding\n", + (std::int64_t)headID, bucket, kMaxRemoteBucketWaitMs); + return; + } + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } + } + + // Pack and enqueue a RemoteAppendRequest for an already-resolved + // remote owner. headVecBytes may be nullptr when the caller has no + // centroid bytes (plain Append into an existing head). + void EnqueueRemoteAppend(int nodeIndex, + SizeType headID, + int appendNum, + std::string posting, + const void* headVecBytes = nullptr) { + RemoteAppendRequest req; + req.m_headID = headID; + req.m_layer = m_layer; + if (headVecBytes != nullptr) { + req.m_headVec.assign(static_cast(headVecBytes), + m_vectorDataSize); + } + req.m_appendNum = appendNum; + req.m_appendPosting = std::move(posting); + m_worker->QueueRemoteAppend(nodeIndex, std::move(req)); + } + + // If headID is owned by a remote node, queue the append for that + // node and return true; otherwise return false (caller continues + // with local write logic). + bool TryRouteRemoteAppend(SizeType headID, + int appendNum, + std::string posting, + const void* headVecBytes = nullptr) { + if (!m_worker || !m_worker->IsEnabled()) return false; + // Only the outer (head) layer participates in the owner-ring + // route. Inner layers (m_layer > 0) hold per-node-local state + // (no shared head VID space, no cross-node TiKV key naming + // contract), so each node services its own inner layer + // independently. Without this gate inner-layer appends would + // also dispatch RPCs that the receiver can't meaningfully + // apply. + if (m_layer != 0) return false; + auto target = m_worker->GetOwner(headID); + if (target.isLocal) return false; + EnqueueRemoteAppend(target.nodeIndex, headID, appendNum, + std::move(posting), headVecBytes); + return true; + } + + // Validate (and lazily extend) the local version map so that + // every (vid, ver) tuple in a posting we are about to write is + // representable. Without this, remote-originated postings carrying + // VIDs above our current Count() get dropped silently. + void EnsureVersionMapCoversPosting(const uint8_t* p_basePtr, size_t p_totalRec, + const char* p_caller, SizeType p_headID) { + const SizeType localCount = m_versionMap->Count(); + SizeType maxVid = -1; + for (size_t i = 0; i < p_totalRec; ++i) { + const uint8_t* p = p_basePtr + i * m_vectorInfoSize; + SizeType vid = *reinterpret_cast(p); + if (vid > maxVid) maxVid = vid; + } + if (maxVid >= localCount) { + SizeType need = maxVid + 1 - localCount; + m_versionMap->AddBatch(need); + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, + "%s: extended local versionMap by %lld (head=%lld maxVid=%lld localCount=%lld)\n", + p_caller, (std::int64_t)need, (std::int64_t)p_headID, + (std::int64_t)maxVid, (std::int64_t)localCount); + } + } virtual bool Available() override { @@ -419,7 +672,12 @@ namespace SPTAG::SPANN { virtual ErrorCode AddIDCapacity(SizeType capa, bool deleted) override { - return m_versionMap->AddBatch(capa, deleted); + // Distributed: grow the version map by the FULL batch size + // (capa * numWorkers), not just this node's slice. Stripe formula + // in AllocateGlobalVID produces globalVIDs up to + // m_initialVectorSize + insertCount * numWorkers. + int numWorkers = GetNumWorkerNodes(); + return m_versionMap->AddBatch(capa * numWorkers, deleted); } SPANN::Index* GetHeadIndex() const { return m_headIndex; } @@ -616,6 +874,23 @@ namespace SPTAG::SPANN { double elapsedMSeconds; uint64_t splitPostingVectors = 0; uint64_t splitNewHeadCount = 0; + + // Only the OWNER of headID should run Split. Remote-issued + // splits get dropped early so we don't mutate a posting that + // doesn't live on this node. + if (m_worker && m_worker->IsEnabled()) { + auto target = m_worker->GetOwner(headID); + if (!target.isLocal) { + std::unique_lock tmplock(m_splitListLock); + m_splitList.unsafe_erase(headID); + return ErrorCode::Success; + } + } + + // Owner-side: wait for any in-flight remote-initiated lock on + // this bucket to release the advisory flag before we mutate. + WaitForRemoteBucketUnlocked(headID); + { std::unique_lock lock(m_rwLocks[headID], std::defer_lock); if (requirelock) { @@ -838,6 +1113,17 @@ namespace SPTAG::SPANN { //SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Split: new head VID %lld already exists in head index. Do merging...\n", (std::int64_t)(newHeadVID)); m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); + // If newHeadVID's owner is a remote node, route + // the new posting via RemoteAppend; the owner + // will merge it into the existing posting list. + if (TryRouteRemoteAppend( + newHeadVID, + (int)(newPostingLists[k].size() / m_vectorInfoSize), + newPostingLists[k], + args.centers + k * args._D)) { + if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); + continue; + } std::string mergedPostingList; std::set vectorIdSet; @@ -925,20 +1211,36 @@ namespace SPTAG::SPANN { SplitAsync(newHeadVID, currentLength); } } else { - auto splitPutBegin = std::chrono::high_resolution_clock::now(); - if ((ret=db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to add new posting %lld\n", (std::int64_t)(newHeadVID)); - return ret; + // If newHeadVID's owner is a remote node, route + // the initial posting via RemoteAppend so it + // ends up in the owner's TiKV. We still add the + // head locally and rely on BroadcastHeadSync + // (after this loop) to spread the head index + // update to all nodes. The receiver's + // AppendCallback materializes the head if its + // HeadSync hasn't arrived yet. + bool remoteCreated = TryRouteRemoteAppend( + newHeadVID, + (int)(newPostingLists[k].size() / m_vectorInfoSize), + newPostingLists[k], + args.centers + k * args._D); + + if (!remoteCreated) { + auto splitPutBegin = std::chrono::high_resolution_clock::now(); + if ((ret=db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to add new posting %lld\n", (std::int64_t)(newHeadVID)); + return ret; + } + CheckCentroid(newHeadVID, newPostingLists[k], "Split-NewPosting"); + auto splitPutEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); + m_stat.m_putCost += elapsedMSeconds; } - CheckCentroid(newHeadVID, newPostingLists[k], "Split-NewPosting"); - auto splitPutEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); - m_stat.m_putCost += elapsedMSeconds; auto updateHeadBegin = std::chrono::high_resolution_clock::now(); if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); - if (db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { + if (!remoteCreated && db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete gc posting %lld\n", (std::int64_t)(newHeadVID)); } return ret; @@ -962,6 +1264,35 @@ namespace SPTAG::SPANN { } } + // Broadcast HeadSync to peer nodes when the head update lands + // in our local BKT (in-memory, per-compute). Lower-layer head + // adds that resolve to m_extraSearchers[m_layer+1]->AddIndex + // already write to shared TiKV so re-broadcasting them would + // only duplicate. + if (m_worker && m_worker->IsEnabled() + && m_headIndex->GetDiskIndex(m_layer + 1) == nullptr) { + std::vector headSyncEntries; + for (int k = 0; k < 2; k++) { + if (args.counts[k] == 0 || (int)newHeadsID.size() <= k) continue; + HeadSyncEntry entry; + entry.op = HeadSyncEntry::Op::Add; + entry.headVID = newHeadsID[k]; + entry.m_layer = m_layer; + entry.headVector.assign(args.centers + k * args._D, args.centers + k * args._D + m_vectorDataSize); + headSyncEntries.push_back(std::move(entry)); + } + if (!theSameHead) { + HeadSyncEntry entry; + entry.op = HeadSyncEntry::Op::Delete; + entry.headVID = headID; + entry.m_layer = m_layer; + headSyncEntries.push_back(std::move(entry)); + } + if (!headSyncEntries.empty()) { + m_worker->BroadcastHeadSync(headSyncEntries); + } + } + { std::unique_lock tmplock(m_splitListLock); //SPTAGLIB_LOG(Helper::LogLevel::LL_Info,"erase: %d\n", headID); @@ -1003,6 +1334,18 @@ namespace SPTAG::SPANN { ErrorCode MergePostings(ExtraWorkSpace *p_exWorkSpace, SizeType headID) { + // The owner runs its own merge passes. Skip when this head is + // owned by another node — we'd just be racing the owner. + if (m_worker && m_worker->IsEnabled()) { + auto target = m_worker->GetOwner(headID); + if (!target.isLocal) { + std::unique_lock tmplock(m_mergeListLock); + m_mergeList.unsafe_erase(headID); + return ErrorCode::Success; + } + } + WaitForRemoteBucketUnlocked(headID); + std::unique_lock lock(m_rwLocks[headID]); if (!m_headIndex->ContainSample(headID, m_layer + 1)) { @@ -1102,23 +1445,61 @@ namespace SPTAG::SPANN { int deletedLength = 0; { std::unique_lock anotherLock(m_rwLocks[queryResult->VID], std::defer_lock); - // SPTAGLIB_LOG(Helper::LogLevel::LL_Info,"Locked: %d, to be lock: %d\n", headID, queryResult->VID); - if (m_rwLocks.hash_func(queryResult->VID) != m_rwLocks.hash_func(headID)) { - if (!anotherLock.try_lock()) { - auto* curJob = new MergeAsyncJob(this, headID, nullptr); - // Re-queue counts as a new submission; matched by the - // m_mergeJobsInFlight-- / m_totalMergeCompleted++ in - // MergeAsyncJob::exec(). Without these increments - // m_mergeJobsInFlight underflows to a huge uint64 - // and m_totalMergeCompleted exceeds m_totalMergeSubmitted. - m_mergeJobsInFlight++; - m_totalMergeSubmitted++; - m_splitThreadPool->add(curJob); - return ErrorCode::Success; + + // RAII guard for the advisory remote bucket lock. + struct RemoteLockGuard { + WorkerNode* router = nullptr; + int nodeIndex = -1; + int layer = 0; + SizeType headID = -1; + bool active = false; + ~RemoteLockGuard() { if (active && router) router->SendRemoteLock(nodeIndex, layer, headID, false); } + void release() { active = false; } + } remoteLockGuard; + + bool isRemoteCandidate = false; + int remoteNodeIndex = -1; + if (m_worker && m_worker->IsEnabled()) { + auto target = m_worker->GetOwner(queryResult->VID); + if (!target.isLocal) { + isRemoteCandidate = true; + remoteNodeIndex = target.nodeIndex; + if (!m_worker->SendRemoteLock(remoteNodeIndex, m_layer, queryResult->VID, true)) { + // Remote owner busy; skip this candidate. + continue; + } + remoteLockGuard.router = m_worker; + remoteLockGuard.nodeIndex = remoteNodeIndex; + remoteLockGuard.layer = m_layer; + remoteLockGuard.headID = queryResult->VID; + remoteLockGuard.active = true; } } - if (!m_headIndex->ContainSample(queryResult->VID, m_layer + 1)) continue; + + if (!isRemoteCandidate) { + // SPTAGLIB_LOG(Helper::LogLevel::LL_Info,"Locked: %d, to be lock: %d\n", headID, queryResult->VID); + if (m_rwLocks.hash_func(queryResult->VID) != m_rwLocks.hash_func(headID)) { + if (!anotherLock.try_lock()) { + auto* curJob = new MergeAsyncJob(this, headID, nullptr); + // Re-queue counts as a new submission; matched by the + // m_mergeJobsInFlight-- / m_totalMergeCompleted++ in + // MergeAsyncJob::exec(). Without these increments + // m_mergeJobsInFlight underflows to a huge uint64 + // and m_totalMergeCompleted exceeds m_totalMergeSubmitted. + m_mergeJobsInFlight++; + m_totalMergeSubmitted++; + m_splitThreadPool->add(curJob); + return ErrorCode::Success; + } + } + if (!m_headIndex->ContainSample(queryResult->VID, m_layer + 1)) continue; + } + if ((ret=db->Get(DBKey(queryResult->VID), &nextPostingList, MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + if (isRemoteCandidate) { + // Stale fetch on remote side; skip and let next round retry. + continue; + } SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to get to be merged posting: %lld, get size:%d\n", (std::int64_t)(queryResult->VID), (int)(nextPostingList.size())); @@ -1143,6 +1524,14 @@ namespace SPTAG::SPANN { nextLength++; } if (resultVec == nullptr) { + if (isRemoteCandidate) { + // Stale fetch / version skew on remote side. Skip + // and let the next merge round retry. + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergePostings: remote candidate %lld has no head record in fetched posting, skipping\n", + (std::int64_t)(queryResult->VID)); + continue; + } SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "MergePostings fail: cannot find another head vector in posting! headID:%lld\n", (std::int64_t)(queryResult->VID)); return ErrorCode::Fail; } @@ -1158,11 +1547,25 @@ namespace SPTAG::SPANN { return ret; } CheckCentroid(headID, mergedPostingList, "MergePostings-currentLength >= nextLength"); - m_headIndex->DeleteIndex(queryResult->VID, m_layer + 1); - if ((ret=db->Delete(DBKey(queryResult->VID))) != ErrorCode::Success) - { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete old posting %lld in Merge\n", (std::int64_t)(queryResult->VID)); - return ret; + if (isRemoteCandidate) { + // Survivor is local; delete remote loser first + // (so we don't have duplicate VID across nodes), + // then drop local head-index entry. + if ((ret=db->Delete(DBKey(queryResult->VID))) != ErrorCode::Success + && ret != ErrorCode::Key_NotFound) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergePostings: remote-loser Delete(%lld) failed; survivor %lld is durable\n", + (std::int64_t)queryResult->VID, (std::int64_t)headID); + return ret; + } + m_headIndex->DeleteIndex(queryResult->VID, m_layer + 1); + } else { + m_headIndex->DeleteIndex(queryResult->VID, m_layer + 1); + if ((ret=db->Delete(DBKey(queryResult->VID))) != ErrorCode::Success) + { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete old posting %lld in Merge\n", (std::int64_t)(queryResult->VID)); + return ret; + } } nextHeadID = headID; nextHeadVec = headVec; @@ -1175,6 +1578,12 @@ namespace SPTAG::SPANN { mergedPostingList += *resultVec; } if ((ret=db->Put(DBKey(queryResult->VID), mergedPostingList, MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + if (isRemoteCandidate) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergePostings: remote-survivor Put(%lld) failed; no state mutated, next round will retry\n", + (std::int64_t)queryResult->VID); + return ret; + } SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "MergePostings fail to override posting %lld after merge\n", (std::int64_t)(queryResult->VID)); return ret; } @@ -1182,6 +1591,12 @@ namespace SPTAG::SPANN { m_headIndex->DeleteIndex(headID, m_layer + 1); if ((ret = db->Delete(DBKey(headID))) != ErrorCode::Success) { + if (isRemoteCandidate) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergePostings: local-loser Delete(%lld) failed; remote survivor %lld is durable\n", + (std::int64_t)headID, (std::int64_t)queryResult->VID); + return ret; + } SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete old posting %lld in Merge\n", (std::int64_t)(headID)); return ret; } @@ -1191,7 +1606,15 @@ namespace SPTAG::SPANN { deletedPostingList = ¤tPostingList; deletedLength = currentLength; } - if (m_rwLocks.hash_func(queryResult->VID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); + if (isRemoteCandidate) { + // Release advisory remote lock before reassign below. + if (remoteLockGuard.active) { + remoteLockGuard.router->SendRemoteLock( + remoteLockGuard.nodeIndex, remoteLockGuard.layer, + remoteLockGuard.headID, false); + remoteLockGuard.release(); + } + } else if (m_rwLocks.hash_func(queryResult->VID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); } // SPTAGLIB_LOG(Helper::LogLevel::LL_Info,"Release: %d, Release: %d\n", headID, queryResult->VID); @@ -1553,6 +1976,38 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Error!, headID :%lld, appendNum:%d\n", (std::int64_t)headID, appendNum); } + // If this head is owned by a remote node, route the append via + // QueueRemoteAppend instead of touching local TiKV. appendNum is + // captured BEFORE std::move(appendPosting) to avoid use-after-move. + // If the batch carries the head's own self-entry (VID == headID), + // forward its vector bytes so the receiver can materialize the + // head index before the BroadcastHeadSync arrives. See the + // matching scan in BatchAppend() for rationale. + { + const uint8_t* basePtr = + reinterpret_cast(appendPosting.data()); + const void* headVecBytes = nullptr; + for (int i = 0; i < appendNum; ++i) { + const uint8_t* p = basePtr + i * m_vectorInfoSize; + SizeType vid = *reinterpret_cast(p); + if (vid == headID) { + headVecBytes = p + m_metaDataSize; + break; + } + } + if (TryRouteRemoteAppend(headID, appendNum, appendPosting, headVecBytes)) { + if (!reassignThreshold) { + m_totalAppendCount++; + m_stat.m_appendTaskNum++; + } + return ErrorCode::Success; + } + } + + // If a remote initiator is currently holding the advisory lock + // on this bucket, wait it out before we touch the posting. + WaitForRemoteBucketUnlocked(headID); + checkDeleted: if (!m_headIndex->ContainSample(headID, m_layer + 1)) { for (int i = 0; i < appendNum; i++) @@ -1684,6 +2139,41 @@ namespace SPTAG::SPANN { auto appendIt = headAppends.find(headID); if (appendIt == headAppends.end()) continue; + // Owner gate: forward heads owned by a remote node via the + // batched RemoteAppend queue. Local heads fall through to + // the standard MultiMerge path below. Without this hook, + // every node writes to every head's TiKV key and the owner + // ring is ignored (no remote RPC, no route stats). + // + // Pass headVecBytes when this batch carries the head's own + // self-entry (VID == headID). During Build-time seed the + // receiver may not yet have the head index entry; without + // headVecBytes its AppendCallback can't materialize the head + // and falls into the ReassignAsync redirect path, dropping + // the self-entry from the posting and later causing + // "MergePostings fail: cannot find head vector in posting!". + { + const std::string& posting = appendIt->second; + const uint8_t* basePtr = + reinterpret_cast(posting.data()); + size_t totalRec = posting.size() / m_vectorInfoSize; + const void* headVecBytes = nullptr; + for (size_t i = 0; i < totalRec; ++i) { + const uint8_t* p = basePtr + i * m_vectorInfoSize; + SizeType vid = *reinterpret_cast(p); + if (vid == headID) { + headVecBytes = p + m_metaDataSize; + break; + } + } + if (TryRouteRemoteAppend(headID, + (int)(posting.size() / m_vectorInfoSize), + posting, + headVecBytes)) { + continue; + } + } + std::unique_lock headLock(m_rwLocks[headID]); if (!m_headIndex->ContainSample(headID, m_layer + 1)) { @@ -1788,6 +2278,10 @@ namespace SPTAG::SPANN { //LOG(Helper::LogLevel::LL_Info, "Reassign: oldVID:%d, replicaCount:%d, candidateNum:%d, dist0:%f\n", oldVID, replicaCount, i, selections[0].distance); for (int i = 0; i < replicaCount && m_versionMap->GetVersion(VID) == version; i++) { //LOG(Helper::LogLevel::LL_Info, "Reassign: headID :%d, oldVID:%d, newVID:%d, posting length: %d, dist: %f, string size: %d\n", headID, oldVID, VID, m_postingSizes[headID].load(), selections[i].distance, newPart.size()); + if (TryRouteRemoteAppend(selections[i].VID, 1, *vectorInfo, + selections[i].Vec.Data())) { + continue; + } // [FIX H3] use reassignThreshold=0 so that an oversized // target posting triggers SplitAsync (not a synchronous // Split on this worker thread). This matches the @@ -1813,6 +2307,7 @@ namespace SPTAG::SPANN { bool LoadIndex(Options& p_opt) override { m_opt = &p_opt; + m_initialVectorSize = p_opt.m_vectorSize; // initial count for VID stripe SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "DataBlockSize: %d, Capacity: %d\n", m_opt->m_datasetRowsInBlock, m_opt->m_datasetCapacity); std::string versionmapPath = m_opt->m_indexDirectory + FolderSep + m_opt->m_deleteIDFile + "_" + std::to_string(m_layer); if (m_opt->m_recovery) { @@ -1901,13 +2396,33 @@ namespace SPTAG::SPANN { } if (m_opt->m_update) { if (m_splitThreadPool == nullptr) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); - - m_splitThreadPool = std::make_shared(); - m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); - //m_reassignThreadPool = std::make_shared(); - //m_reassignThreadPool->initSPDK(m_opt->m_reassignThreadNum, this); - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization\n"); + // Only layer 0 participates in the shared-pool slot: + // it both adopts (if a sibling published first) and + // publishes (so the WorkerNode receiver and any later + // layer-0 instance can reuse the same threads). + // Inner layers (m_layer > 0) always create their own + // pool, matching qianxi's per-instance pool design. + if (m_layer == 0 && m_headIndex) { + auto shared = m_headIndex->GetSharedSplitPool(); + if (shared) { + m_splitThreadPool = std::static_pointer_cast(shared); + } + } + if (m_splitThreadPool == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); + + m_splitThreadPool = std::make_shared(); + m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); + //m_reassignThreadPool = std::make_shared(); + //m_reassignThreadPool->initSPDK(m_opt->m_reassignThreadNum, this); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization\n"); + if (m_layer == 0 && m_headIndex) m_headIndex->SetSharedSplitPool(m_splitThreadPool); + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: adopted shared split pool from sibling layer\n"); + } + // Pool is now ready: re-attempt wiring the worker's job + // submitter (may have been set before pool was alive). + WireJobSubmitterIfReady(); } if (m_opt->m_enableWAL && !m_opt->m_persistentBufferPath.empty()) { @@ -2345,6 +2860,7 @@ namespace SPTAG::SPANN { { auto fullVectors = p_reader->GetVectorSet(); fullCount = fullVectors->Count(); + m_initialVectorSize = fullCount; // remember bulk-build count for stripe formula m_metaDataSize = sizeof(SizeType) + sizeof(uint8_t); m_vectorDataSize = fullVectors->PerVectorDataSize(); m_vectorInfoSize = m_vectorDataSize + m_metaDataSize; @@ -2556,10 +3072,20 @@ namespace SPTAG::SPANN { if (m_opt->m_update && !m_opt->m_allowZeroReplica && zeroReplicaCount > 0) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); - m_splitThreadPool = std::make_shared(); - m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization, zeroReplicaCount:%zu\n", zeroReplicaCount); + if (m_splitThreadPool == nullptr && m_layer == 0 && m_headIndex) { + auto shared = m_headIndex->GetSharedSplitPool(); + if (shared) { + m_splitThreadPool = std::static_pointer_cast(shared); + } + } + if (m_splitThreadPool == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); + m_splitThreadPool = std::make_shared(); + m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization, zeroReplicaCount:%zu\n", zeroReplicaCount); + if (m_layer == 0 && m_headIndex) m_headIndex->SetSharedSplitPool(m_splitThreadPool); + } + WireJobSubmitterIfReady(); uint32_t splitNumBeforeZeroReplica = m_stat.m_splitNum; uint32_t reassignNumBeforeZeroReplica = m_stat.m_reAssignNum; @@ -2834,6 +3360,16 @@ namespace SPTAG::SPANN { return ErrorCode::VectorNotFound; } + ErrorCode FlushRemoteAppends() { + if (m_worker && m_worker->IsEnabled()) { + ErrorCode ret = m_worker->FlushRemoteAppends(); + m_worker->LogRouteStats(" (batch flush)"); + m_worker->ResetRouteStats(); + return ret; + } + return ErrorCode::Success; + } + bool AllFinished() { if (!m_splitThreadPool) return true; diff --git a/AnnService/inc/Core/SPANN/ExtraTiKVController.h b/AnnService/inc/Core/SPANN/ExtraTiKVController.h index d7528d479..0541eaad1 100644 --- a/AnnService/inc/Core/SPANN/ExtraTiKVController.h +++ b/AnnService/inc/Core/SPANN/ExtraTiKVController.h @@ -12,6 +12,7 @@ #include "kvproto/tikvpb.grpc.pb.h" #include "kvproto/kvrpcpb.pb.h" #include "kvproto/metapb.pb.h" +#include "kvproto/pdpb.pb.h" #include "kvproto/pdpb.grpc.pb.h" #include diff --git a/AnnService/inc/Core/SPANN/IExtraSearcher.h b/AnnService/inc/Core/SPANN/IExtraSearcher.h index 554b02421..ec8d8bf95 100644 --- a/AnnService/inc/Core/SPANN/IExtraSearcher.h +++ b/AnnService/inc/Core/SPANN/IExtraSearcher.h @@ -22,6 +22,11 @@ namespace SPTAG { namespace SPANN { + // Forward declaration; the only IExtraSearcher API that touches WorkerNode + // is the SetWorker() hook below. Concrete searchers that care + // (ExtraDynamicSearcher) include the full header and override. + class WorkerNode; + struct SearchStats { SearchStats() @@ -589,6 +594,11 @@ namespace SPTAG { SizeType p_begin) { return ErrorCode::Undefined; } virtual ErrorCode DeleteIndex(SizeType p_id) { return ErrorCode::Undefined; } + // Allocate globalVID to this node's BKT counter. + // ExtraDynamicSearcher overrides this with + // the stripe formula when m_worker is enabled. + virtual SizeType AllocateGlobalVID(SizeType p_localVID) const { return p_localVID; } + virtual SizeType GetNumSamples() const = 0; virtual bool ContainSample(const SizeType idx) const @@ -624,6 +634,11 @@ namespace SPTAG { return ErrorCode::Undefined; } + // Bind a routing worker (no-op by default). ExtraDynamicSearcher + // overrides this to install the cross-node append + put + + // fetch-postings callbacks. ExtraStaticSearcher etc. ignore it. + virtual void SetWorker(WorkerNode* /*worker*/) {} + virtual bool AllFinished() { return false; } virtual void GetDBStats() { return; } virtual int64_t GetNumBlocks() { return 0; } @@ -640,6 +655,8 @@ namespace SPTAG { } virtual ErrorCode Checkpoint(std::string prefix) { return ErrorCode::Success; } + + virtual void InitWorkSpace(ExtraWorkSpace* p_exWorkSpace, bool clear = false) {} }; } // SPANN } // SPTAG diff --git a/AnnService/inc/Core/SPANN/Index.h b/AnnService/inc/Core/SPANN/Index.h index 5479d2d42..255043a58 100644 --- a/AnnService/inc/Core/SPANN/Index.h +++ b/AnnService/inc/Core/SPANN/Index.h @@ -47,6 +47,11 @@ namespace SPTAG template class SPANNResultIterator; + // Forward-declare so Index can hold/forward a WorkerNode pointer + // without dragging in the full Distributed/WorkerNode.h header (and + // thus its boost-asio + grpc transitive deps) into Index.h. + class WorkerNode; + template class Index; template @@ -63,6 +68,12 @@ namespace SPTAG std::vector> m_extraSearchers; std::unique_ptr> m_workSpaceFactory; + // Routing worker bound BEFORE BuildIndex so that + // ExtraDynamicSearcher::WriteDownAllPostingToDB and other build + // hooks see a non-null m_worker as each layer's searcher is + // emplaced. SPFreshTest sets this in BuildOnly+Distributed mode. + WorkerNode* m_pendingWorker = nullptr; + Options m_options; std::function m_fComputeDistance; @@ -85,6 +96,14 @@ namespace SPTAG std::shared_ptr> m_freeWorkSpaceIds; std::atomic m_workspaceCount = 0; + // Single split/append thread pool shared by all extraSearchers + // (one per layer). Lazily populated by the first layer that + // initializes its pool inside LoadIndex; subsequent layers + // adopt the same shared instance so the total worker count + // is AppendThreadNum (not AppendThreadNum * layers). + mutable std::mutex m_sharedSplitPoolMutex; + std::shared_ptr m_sharedSplitPool; + public: Index() { @@ -124,6 +143,27 @@ namespace SPTAG inline std::shared_ptr GetDiskIndex(int layer = 0) { if (layer < m_extraSearchers.size()) return m_extraSearchers[layer]; else return nullptr; } inline Options* GetOptions() { return &m_options; } + // Bind a routing worker. Forwards to all currently-existing + // extraSearchers and remembers the pointer so newly-emplaced + // searchers (created during BuildIndexInternalLayer) also pick + // it up. Pass nullptr to detach. + void SetWorker(WorkerNode* worker) { + m_pendingWorker = worker; + for (auto& searcher : m_extraSearchers) { + if (searcher) searcher->SetWorker(worker); + } + } + inline WorkerNode* GetPendingWorker() const { return m_pendingWorker; } + + inline std::shared_ptr GetSharedSplitPool() const { + std::lock_guard lk(m_sharedSplitPoolMutex); + return m_sharedSplitPool; + } + inline void SetSharedSplitPool(std::shared_ptr pool) { + std::lock_guard lk(m_sharedSplitPoolMutex); + m_sharedSplitPool = std::move(pool); + } + inline SizeType GetNumSamples() const { return GetNumSamples(0); } inline SizeType GetNumSamples(int layer) const { if (layer < m_extraSearchers.size()) return m_extraSearchers[layer]->GetNumSamples(); else return m_topIndex->GetNumSamples(); } inline DimensionType GetFeatureDim() const { return m_topIndex->GetFeatureDim(); } diff --git a/AnnService/inc/Core/VectorIndex.h b/AnnService/inc/Core/VectorIndex.h index a25bf1e63..62e2ca843 100644 --- a/AnnService/inc/Core/VectorIndex.h +++ b/AnnService/inc/Core/VectorIndex.h @@ -5,6 +5,7 @@ #define _SPTAG_VECTORINDEX_H_ #include +#include #include "Common.h" #include "Common/WorkSpace.h" #include "inc/Helper/DiskIO.h" @@ -160,6 +161,14 @@ class VectorIndex static ErrorCode LoadIndex(const std::string& p_loaderFilePath, std::shared_ptr& p_vectorIndex); + /// LoadIndex with config overrides applied between LoadIndexConfig and LoadIndexData, + /// so settings such as TiKVPDAddresses take effect before the underlying KV connection + /// is constructed. Override keys may be section-qualified ("Section.Param"); unqualified + /// keys default to the "BuildSSDIndex" section. + static ErrorCode LoadIndex(const std::string& p_loaderFilePath, + const std::map& p_paramOverrides, + std::shared_ptr& p_vectorIndex); + static ErrorCode LoadIndexFromFile(const std::string& p_file, std::shared_ptr& p_vectorIndex); static ErrorCode LoadIndex(const std::string& p_config, const std::vector& p_indexBlobs, std::shared_ptr& p_vectorIndex); diff --git a/AnnService/inc/Helper/KeyValueIO.h b/AnnService/inc/Helper/KeyValueIO.h index a7c3c25b8..9d7c1e2a3 100644 --- a/AnnService/inc/Helper/KeyValueIO.h +++ b/AnnService/inc/Helper/KeyValueIO.h @@ -34,6 +34,20 @@ namespace SPTAG virtual ErrorCode Put(const SizeType key, const std::string& value, const std::chrono::microseconds& timeout, std::vector* reqs) = 0; + // Batched writes/deletes. Default implementations return Undefined so that + // backends without native batching (RocksDB, FileIO) can ignore them. + // TiKVIO overrides these to issue a single batched RPC per region group, + // which dramatically reduces the number of synchronous gRPC round-trips + // when callers (e.g. SPANN AddIndex Phase 2 / PutPostingToDB) want to + // commit several keys at once. + virtual ErrorCode MultiPut(const std::vector& keys, + const std::vector& values, + const std::chrono::microseconds& timeout, + std::vector* reqs) { return ErrorCode::Undefined; } + + virtual ErrorCode MultiDelete(const std::vector& keys, + const std::chrono::microseconds& timeout) { return ErrorCode::Undefined; } + virtual ErrorCode Merge(const SizeType key, const std::string &value, const std::chrono::microseconds &timeout, std::vector *reqs, int& size) = 0; diff --git a/AnnService/inc/Helper/ThreadPool.h b/AnnService/inc/Helper/ThreadPool.h index 01c82e2a7..a351a75c8 100644 --- a/AnnService/inc/Helper/ThreadPool.h +++ b/AnnService/inc/Helper/ThreadPool.h @@ -5,7 +5,7 @@ #define _SPTAG_HELPER_THREADPOOL_H_ #include -#include +#include #include #include #include @@ -78,28 +78,42 @@ namespace SPTAG { { std::lock_guard lock(m_lock); - m_jobs.push_back(j); + m_jobs.push(j); } m_cond.notify_one(); } - void addfront(Job* j) + // High-priority push: jobs in m_highJobs always run before m_jobs. + // Used by the distributed receiver to let inbound BatchAppend RPC + // work jump ahead of local Split/Merge/Reassign so the sender + // (driver) doesn't time out waiting for the chunk ack while the + // local pool drains long-running rebalance work. + void add_high(Job* j) { { std::lock_guard lock(m_lock); - m_jobs.push_front(j); + m_highJobs.push(j); } m_cond.notify_one(); } + // Alias kept for compatibility with code that calls addfront() + // (e.g., split-async path). Same semantics as add_high. + void addfront(Job* j) { add_high(j); } + bool get(Job*& j) { std::unique_lock lock(m_lock); - while (m_jobs.empty() && !m_abort.ShouldAbort()) m_cond.wait(lock); + while (m_jobs.empty() && m_highJobs.empty() && !m_abort.ShouldAbort()) m_cond.wait(lock); if (!m_abort.ShouldAbort()) { - j = m_jobs.front(); + if (!m_highJobs.empty()) { + j = m_highJobs.front(); + m_highJobs.pop(); + } else { + j = m_jobs.front(); + m_jobs.pop(); + } currentJobs++; - m_jobs.pop_front(); return true; } return false; @@ -108,7 +122,7 @@ namespace SPTAG size_t jobsize() { std::lock_guard lock(m_lock); - return m_jobs.size(); + return m_jobs.size() + m_highJobs.size(); } inline uint32_t runningJobs() { return currentJobs; } @@ -122,7 +136,8 @@ namespace SPTAG protected: std::atomic_uint32_t currentJobs{ 0 }; - std::deque m_jobs; + std::queue m_jobs; + std::queue m_highJobs; Abort m_abort; std::mutex m_lock; std::condition_variable m_cond; diff --git a/AnnService/inc/Socket/ConnectionManager.h b/AnnService/inc/Socket/ConnectionManager.h index e487c6105..0c199ecb1 100644 --- a/AnnService/inc/Socket/ConnectionManager.h +++ b/AnnService/inc/Socket/ConnectionManager.h @@ -41,7 +41,11 @@ class ConnectionManager : public std::enable_shared_from_this inline static std::uint32_t GetPosition(ConnectionID p_connectionID); private: - static constexpr std::uint32_t c_connectionPoolSize = 1 << 8; + // Bumped from 1<<8 (256) to 1<<12 (4096) to avoid silently dropping new + // connections when reconnect storms (e.g., from concurrent FlushRemoteAppends + // timeouts) saturate the pool. Each ConnectionItem is small; 4096 slots is + // ~64KB per ConnectionManager, which is negligible. + static constexpr std::uint32_t c_connectionPoolSize = 1 << 12; static constexpr std::uint32_t c_connectionPoolMask = c_connectionPoolSize - 1; diff --git a/AnnService/inc/Socket/Packet.h b/AnnService/inc/Socket/Packet.h index 8c99b09fe..6d8c1d146 100644 --- a/AnnService/inc/Socket/Packet.h +++ b/AnnService/inc/Socket/Packet.h @@ -27,13 +27,47 @@ enum class PacketType : std::uint8_t SearchRequest = 0x03, + AppendRequest = 0x04, + + BatchAppendRequest = 0x05, + + HeadSyncRequest = 0x07, + + RemoteLockRequest = 0x08, + + DispatchCommand = 0x09, + + NodeRegisterRequest = 0x0A, + + RingUpdate = 0x0B, + + RingUpdateACK = 0x0C, + + // Cross-node merge hint. Search on node X observes posting H is + // underfull, but H is owned by node Y. X sends MergeRequest to Y so + // Y can schedule its own MergeAsync(H). Fire-and-forget (no response + // packet): the receiver's MergeAsync already dedups via m_mergeList, + // a lost notification just means Y discovers H underfull via some + // other path (own search, own Append, explicit RefineIndex). + MergeRequest = 0x11, + ResponseMask = 0x80, + NodeRegisterResponse = ResponseMask | NodeRegisterRequest, + HeartbeatResponse = ResponseMask | HeartbeatRequest, RegisterResponse = ResponseMask | RegisterRequest, - SearchResponse = ResponseMask | SearchRequest + SearchResponse = ResponseMask | SearchRequest, + + AppendResponse = ResponseMask | AppendRequest, + + BatchAppendResponse = ResponseMask | BatchAppendRequest, + + RemoteLockResponse = ResponseMask | RemoteLockRequest, + + DispatchResult = ResponseMask | DispatchCommand, }; diff --git a/AnnService/inc/Socket/SimpleSerialization.h b/AnnService/inc/Socket/SimpleSerialization.h index 6da925625..e0b8141dd 100644 --- a/AnnService/inc/Socket/SimpleSerialization.h +++ b/AnnService/inc/Socket/SimpleSerialization.h @@ -82,6 +82,58 @@ namespace SimpleSerialization } + /// Bounds-checked variants of SimpleReadBuffer. + /// All return nullptr if a read would overrun [p_buffer, p_bufEnd). + /// p_buffer is also returned as nullptr (and p_val left unchanged) if it is already nullptr. + template + inline const std::uint8_t* + SafeSimpleReadBuffer(const std::uint8_t* p_buffer, const std::uint8_t* p_bufEnd, T& p_val) + { + static_assert(std::is_fundamental::value || std::is_enum::value, + "Only applied for fundanmental type."); + + if (p_buffer == nullptr) return nullptr; + if (p_bufEnd != nullptr && static_cast(p_bufEnd - p_buffer) < sizeof(T)) return nullptr; + p_val = *(reinterpret_cast(p_buffer)); + return p_buffer + sizeof(T); + } + + + inline const std::uint8_t* + SafeSimpleReadBuffer(const std::uint8_t* p_buffer, const std::uint8_t* p_bufEnd, std::string& p_val) + { + p_val.clear(); + if (p_buffer == nullptr) return nullptr; + std::uint32_t len = 0; + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, len); + if (p_buffer == nullptr) return nullptr; + if (len > 0) + { + if (p_bufEnd != nullptr && static_cast(p_bufEnd - p_buffer) < len) return nullptr; + p_val.assign(reinterpret_cast(p_buffer), len); + } + return p_buffer + len; + } + + + inline const std::uint8_t* + SafeSimpleReadBuffer(const std::uint8_t* p_buffer, const std::uint8_t* p_bufEnd, ByteArray& p_val) + { + p_val.Clear(); + if (p_buffer == nullptr) return nullptr; + std::uint32_t len = 0; + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, len); + if (p_buffer == nullptr) return nullptr; + if (len > 0) + { + if (p_bufEnd != nullptr && static_cast(p_bufEnd - p_buffer) < len) return nullptr; + p_val = ByteArray::Alloc(len); + std::memcpy(p_val.Data(), p_buffer, len); + } + return p_buffer + len; + } + + template<> inline std::size_t EstimateBufferSize(const std::string& p_val) diff --git a/AnnService/src/Core/SPANN/ExtraFileController.cpp b/AnnService/src/Core/SPANN/ExtraFileController.cpp index 24c839455..b5db83822 100644 --- a/AnnService/src/Core/SPANN/ExtraFileController.cpp +++ b/AnnService/src/Core/SPANN/ExtraFileController.cpp @@ -25,7 +25,7 @@ bool FileIO::BlockController::Initialize(SPANN::Options &p_opt, int p_layer) #ifndef _MSC_VER O_RDWR | O_DIRECT, numblocks, 2, 2, max(p_opt.m_ioThreads, (2 * max(p_opt.m_searchThreadNum, p_opt.m_iSSDNumberOfThreads) + - (p_opt.m_layers + 1) * (p_opt.m_insertThreadNum + p_opt.m_reassignThreadNum + p_opt.m_appendThreadNum))), + p_opt.m_insertThreadNum + p_opt.m_reassignThreadNum + p_opt.m_appendThreadNum)), ((std::uint64_t)p_opt.m_startFileSize) << 30 #else GENERIC_READ | GENERIC_WRITE, numblocks, 2, 2, diff --git a/AnnService/src/Core/SPANN/SPANNIndex.cpp b/AnnService/src/Core/SPANN/SPANNIndex.cpp index f3f83dca6..38ea1c72d 100644 --- a/AnnService/src/Core/SPANN/SPANNIndex.cpp +++ b/AnnService/src/Core/SPANN/SPANNIndex.cpp @@ -1227,6 +1227,15 @@ template ErrorCode Index::BuildIndexInternalLayer(std::shared_pt m_extraSearchers.emplace_back(std::make_shared>(m_options, m_extraSearchers.size(), this, m_db)); } + // Hand the routing worker (if any) to the freshly-created searcher + // before BuildIndex runs. Build itself no longer routes postings + // (shared TiKV cluster — the driver writes straight to TiKV and PD + // routes each key to the owning store), but other build-time hooks + // that consult m_worker still benefit from seeing a non-null value. + if (m_pendingWorker) { + m_extraSearchers.back()->SetWorker(m_pendingWorker); + } + { std::shared_ptr ptr = SPTAG::f_createIO(); if (ptr == nullptr || @@ -1862,7 +1871,74 @@ ErrorCode Index::AddIndex(const void *p_data, SizeType p_vectorNum, Dimension } workSpace->m_deduper.clear(); workSpace->m_postingIDs.clear(); - return m_extraSearchers[0]->AddIndex(workSpace.get(), vectorSet, begin); + + // Use multiple threads for RNGSelection + Append when vector count is large enough. + // Each thread fetch_add's one vector and calls ExtraDynamicSearcher::AddIndex with a + // single-vector view, so AppendBatchAsync flushes per-vector and pipelines with the + // worker side rather than queuing the whole batch behind a single huge flush. + if (p_vectorNum > 1 && m_options.m_iSSDNumberOfThreads > 1) { + int numThreads = std::min((int)p_vectorNum, m_options.m_iSSDNumberOfThreads); + std::atomic_int nextVec{0}; + std::atomic globalError{ErrorCode::Success}; + int printStep = std::max(1, p_vectorNum / 50); + + auto worker = [&](bool isFirst) { + std::unique_ptr ws; + ExtraWorkSpace* wsPtr; + if (isFirst) { + wsPtr = workSpace.get(); + } else { + ws = m_workSpaceFactory->GetWorkSpace(); + if (!ws) { + ws.reset(new ExtraWorkSpace()); + InitWorkSpace(ws.get(), false); + } else { + InitWorkSpace(ws.get(), true); + } + ws->m_deduper.clear(); + ws->m_postingIDs.clear(); + wsPtr = ws.get(); + } + + while (globalError.load(std::memory_order_relaxed) == ErrorCode::Success) { + int v = nextVec.fetch_add(1); + if (v >= p_vectorNum) break; + + if (v % printStep == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "AddIndex bulk: %d/%d (%.1f%%)\n", + v, p_vectorNum, v * 100.0 / p_vectorNum); + GetDBStat(); + } + + std::shared_ptr singleVec = std::make_shared( + ByteArray((std::uint8_t*)vectorSet->GetVector(v), + sizeof(T) * p_dimension, false), + GetEnumValueType(), p_dimension, 1); + ErrorCode ret = m_extraSearchers[0]->AddIndex(wsPtr, singleVec, + m_extraSearchers[0]->AllocateGlobalVID(begin + v)); + if (ret != ErrorCode::Success) { + globalError.store(ret, std::memory_order_relaxed); + } + } + + if (!isFirst && ws) { + m_workSpaceFactory->ReturnWorkSpace(std::move(ws)); + } + }; + + std::vector threads; + threads.reserve(numThreads - 1); + for (int t = 1; t < numThreads; t++) { + threads.emplace_back(worker, false); + } + worker(true); + for (auto& t : threads) t.join(); + + return globalError.load(); + } + + return m_extraSearchers[0]->AddIndex(workSpace.get(), vectorSet, + m_extraSearchers[0]->AllocateGlobalVID(begin)); } template diff --git a/AnnService/src/Core/VectorIndex.cpp b/AnnService/src/Core/VectorIndex.cpp index 2f8ebfd13..35bcaf585 100644 --- a/AnnService/src/Core/VectorIndex.cpp +++ b/AnnService/src/Core/VectorIndex.cpp @@ -793,6 +793,14 @@ std::shared_ptr VectorIndex::CreateInstance(IndexAlgoType p_algo, V } ErrorCode VectorIndex::LoadIndex(const std::string &p_loaderFilePath, std::shared_ptr &p_vectorIndex) +{ + static const std::map emptyOverrides; + return LoadIndex(p_loaderFilePath, emptyOverrides, p_vectorIndex); +} + +ErrorCode VectorIndex::LoadIndex(const std::string &p_loaderFilePath, + const std::map &p_paramOverrides, + std::shared_ptr &p_vectorIndex) { std::string folderPath(p_loaderFilePath); if (!folderPath.empty() && *(folderPath.rbegin()) != FolderSep) @@ -816,6 +824,23 @@ ErrorCode VectorIndex::LoadIndex(const std::string &p_loaderFilePath, std::share if ((ret = p_vectorIndex->LoadIndexConfig(iniReader)) != ErrorCode::Success) return ret; + // Apply param overrides AFTER LoadIndexConfig but BEFORE LoadIndexData, so that + // settings like TiKVPDAddresses are reflected in m_options before the KV connection + // is constructed inside LoadIndexData -> PrepareDB. + for (const auto &kv : p_paramOverrides) + { + const std::string &key = kv.first; + const std::string &val = kv.second; + auto dotPos = key.find('.'); + if (dotPos != std::string::npos) { + std::string section = key.substr(0, dotPos); + std::string param = key.substr(dotPos + 1); + p_vectorIndex->SetParameter(param.c_str(), val.c_str(), section.c_str()); + } else { + p_vectorIndex->SetParameter(key.c_str(), val.c_str(), "BuildSSDIndex"); + } + } + std::shared_ptr> indexfiles = p_vectorIndex->GetIndexFiles(); if (iniReader.DoesSectionExist("MetaData")) { diff --git a/AnnService/src/Socket/Connection.cpp b/AnnService/src/Socket/Connection.cpp index 150889d2f..444c7afb0 100644 --- a/AnnService/src/Socket/Connection.cpp +++ b/AnnService/src/Socket/Connection.cpp @@ -26,10 +26,19 @@ Connection::Connection(ConnectionID p_connectionID, boost::asio::ip::tcp::socket void Connection::Start() { - SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "Connection Start, local: %u, remote: %s:%u\n", - static_cast(m_socket.local_endpoint().port()), - m_socket.remote_endpoint().address().to_string().c_str(), - static_cast(m_socket.remote_endpoint().port())); + boost::system::error_code epEc; + auto localEp = m_socket.local_endpoint(epEc); + auto remoteEp = m_socket.remote_endpoint(epEc); + if (!epEc) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "Connection Start, local: %u, remote: %s:%u\n", + static_cast(localEp.port()), + remoteEp.address().to_string().c_str(), + static_cast(remoteEp.port())); + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Connection Start, socket not connected: %s\n", + epEc.message().c_str()); + return; + } if (!m_stopped.exchange(false)) { @@ -42,10 +51,15 @@ void Connection::Start() void Connection::Stop() { - SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "Connection Stop, local: %u, remote: %s:%u\n", - static_cast(m_socket.local_endpoint().port()), - m_socket.remote_endpoint().address().to_string().c_str(), - static_cast(m_socket.remote_endpoint().port())); + boost::system::error_code epEc; + auto localEp = m_socket.local_endpoint(epEc); + auto remoteEp = m_socket.remote_endpoint(epEc); + if (!epEc) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "Connection Stop, local: %u, remote: %s:%u\n", + static_cast(localEp.port()), + remoteEp.address().to_string().c_str(), + static_cast(remoteEp.port())); + } if (m_stopped.exchange(true)) { diff --git a/AnnService/src/Socket/Server.cpp b/AnnService/src/Socket/Server.cpp index 9781bf1d4..8be0682c6 100644 --- a/AnnService/src/Socket/Server.cpp +++ b/AnnService/src/Socket/Server.cpp @@ -26,7 +26,7 @@ Server::Server(const std::string &p_address, const std::string &p_port, const Pa boost::asio::ip::tcp::endpoint endpoint = *(endPoints.begin()); m_acceptor.open(endpoint.protocol()); - m_acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(false)); + m_acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); m_acceptor.bind(endpoint, errCode); if (errCode) diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index 52f4168a9..27bdeebb5 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -24,7 +24,7 @@ if (NOT LIBRARYONLY) file(GLOB TEST_HDR_FILES ${PROJECT_SOURCE_DIR}/Test/inc/Test.h) file(GLOB TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/Test/src/*.cpp) add_executable(SPTAGTest ${TEST_SRC_FILES} ${TEST_HDR_FILES}) - target_link_libraries(SPTAGTest SPTAGLibStatic ssdservingLib ${Boost_LIBRARIES}) + target_link_libraries(SPTAGTest SPTAGLibStatic ssdservingLib ${Boost_LIBRARIES} absl_synchronization absl_cord absl_cordz_info absl_cord_internal absl_cordz_functions absl_cordz_handle) install(TARGETS SPTAGTest RUNTIME DESTINATION bin diff --git a/Test/inc/TestDataGenerator.h b/Test/inc/TestDataGenerator.h index 5820c8422..9f958f43d 100644 --- a/Test/inc/TestDataGenerator.h +++ b/Test/inc/TestDataGenerator.h @@ -29,7 +29,20 @@ namespace TestUtils { static std::shared_ptr LoadMetadataSet(const std::string pmetaset, const std::string pmetaidx, SPTAG::SizeType start = 0, SPTAG::SizeType count = -1); - static float EvaluateRecall(const std::vector &res, std::shared_ptr &truth, int recallK, int k, int batch, int totalbatches); + // Compute recall against truth file. + // + // Distributed (per-node) recall: when each node only owns a SUBSET of + // the global query set, pass the global query count and this node's + // query offset so the truth row indexing is computed in global terms. + // The truth file is laid out as: + // [iter=0 VIDs for queries 0..Q-1] [iter=1 VIDs ...] ... + // [iter=0 dists for queries 0..Q-1] [iter=1 dists ...] ... + // where Q is the GLOBAL query count, NOT res.size(). With the legacy + // res.size()-based formula, distributed batches > 0 read the wrong + // rows (off by Q-myCount), giving near-random recall that's noise. + // totalQueries=-1 (default) preserves the legacy single-node formula. + static float EvaluateRecall(const std::vector &res, std::shared_ptr &truth, int recallK, int k, int batch, int totalbatches, + int totalQueries = -1, int queryOffset = 0); void RunBatches(std::shared_ptr &vecset, std::shared_ptr &metaset, std::shared_ptr &addvecset, std::shared_ptr &addmetaset, diff --git a/Test/src/SPFreshTest.cpp b/Test/src/SPFreshTest.cpp index 95c1fc4d5..9ab420db9 100644 --- a/Test/src/SPFreshTest.cpp +++ b/Test/src/SPFreshTest.cpp @@ -5,6 +5,10 @@ #include "inc/Core/Common/DistanceUtils.h" #include "inc/Core/Common/QueryResultSet.h" #include "inc/Core/SPANN/Index.h" +#include "inc/Core/SPANN/Distributed/WorkerNode.h" +#include "inc/Core/SPANN/Distributed/DispatcherNode.h" +#include "inc/Core/SPANN/ExtraDynamicSearcher.h" +#include "inc/Core/SPANN/ExtraTiKVController.h" #include "inc/Core/SPANN/SPANNResultIterator.h" #include "inc/Core/VectorIndex.h" #include "inc/Core/Common/IQuantizer.h" @@ -17,10 +21,13 @@ #include "inc/Test.h" #include "inc/TestDataGenerator.h" +#include #include #include +#include #include #include +#include #include #include #include @@ -55,6 +62,181 @@ static __attribute__((constructor)) void install_segfault_handler() { using namespace SPTAG; +// --------------------------------------------------------------------------- +// Stride sharding (a.k.a. odd/even sharding) experiment +// --------------------------------------------------------------------------- +// When the env var SPFRESH_SHARD_STRIDE is set to "1"/"true", each node, instead +// of inserting a contiguous slice [n*B/N, (n+1)*B/N) of the per-iteration batch, +// inserts the strided rows {n, n+N, n+2*N, ...} where n=nodeIndex, N=numNodes. +// This breaks any spatial structure in the input dataset (e.g. SIFT files that +// are roughly sorted by visual feature), letting us check whether the layer-0 +// split skew (driver 71 vs worker 2 in v18) is caused by contiguous slicing +// landing similar vectors on the same node and overflowing a small set of heads. +// +// The total number of vectors inserted across all nodes per iteration is the +// same; only the assignment changes. Recall measurement still works because +// the dataset and ground truth are unchanged — only insert routing differs. +static bool IsStrideShardEnabled() { + const char* e = std::getenv("SPFRESH_SHARD_STRIDE"); + if (!e) return false; + std::string v(e); + return v == "1" || v == "true" || v == "TRUE" || v == "yes"; +} + +// Compute count of indices i in [0, total) with (i % stride) == offset. +static SizeType StrideCount(SizeType total, int stride, int offset) { + if (stride <= 1) return total; + if (offset < 0 || offset >= stride) return 0; + if (total <= offset) return 0; + return (total - 1 - offset) / stride + 1; +} + +// Build a strided sub-VectorSet by copying every `stride`-th vector starting +// at `offset` into a contiguous packed ByteArray. Returns a BasicVectorSet. +static std::shared_ptr ExtractStridedVectors( + const std::shared_ptr& full, int stride, int offset) +{ + if (!full) return nullptr; + SizeType totalCount = full->Count(); + SizeType outCount = StrideCount(totalCount, stride, offset); + auto vt = full->GetValueType(); + auto dim = full->Dimension(); + size_t perVecSize = full->PerVectorDataSize(); + if (outCount <= 0) { + return std::make_shared(ByteArray::Alloc(0), vt, dim, 0); + } + ByteArray buf = ByteArray::Alloc(static_cast(outCount) * perVecSize); + for (SizeType i = 0; i < outCount; ++i) { + SizeType srcIdx = static_cast(offset) + i * static_cast(stride); + std::memcpy(buf.Data() + static_cast(i) * perVecSize, + full->GetVector(srcIdx), + perVecSize); + } + return std::make_shared(buf, vt, dim, outCount); +} + +// Build a strided sub-MetadataSet. Two-pass: first compute offsets, then copy. +static std::shared_ptr ExtractStridedMetadata( + const std::shared_ptr& full, int stride, int offset) +{ + if (!full) return nullptr; + SizeType totalCount = full->Count(); + SizeType outCount = StrideCount(totalCount, stride, offset); + if (outCount <= 0) { + ByteArray emptyMeta = ByteArray::Alloc(0); + ByteArray offBuf = ByteArray::Alloc(sizeof(std::uint64_t)); + *reinterpret_cast(offBuf.Data()) = 0ULL; + return std::make_shared(emptyMeta, offBuf, 0); + } + std::vector offsets(static_cast(outCount) + 1, 0ULL); + std::uint64_t total = 0; + for (SizeType i = 0; i < outCount; ++i) { + SizeType srcIdx = static_cast(offset) + i * static_cast(stride); + ByteArray meta = full->GetMetadata(srcIdx); + offsets[i] = total; + total += meta.Length(); + } + offsets[outCount] = total; + ByteArray metaBuf = ByteArray::Alloc(total > 0 ? total : 1); + for (SizeType i = 0; i < outCount; ++i) { + SizeType srcIdx = static_cast(offset) + i * static_cast(stride); + ByteArray meta = full->GetMetadata(srcIdx); + if (meta.Length() > 0) { + std::memcpy(metaBuf.Data() + offsets[i], meta.Data(), meta.Length()); + } + } + ByteArray offBuf = ByteArray::Alloc((static_cast(outCount) + 1) * sizeof(std::uint64_t)); + std::memcpy(offBuf.Data(), offsets.data(), offsets.size() * sizeof(std::uint64_t)); + return std::make_shared(metaBuf, offBuf, outCount); +} + +// Helper: parse "host:port,host:port,..." into vector of pairs. +static std::vector> ParseNodeAddrs(const std::string& addrStr) { + std::vector> result; + auto parts = Helper::StrUtils::SplitString(addrStr, ","); + for (auto& part : parts) { + auto hp = Helper::StrUtils::SplitString(part, ":"); + if (hp.size() == 2) result.emplace_back(hp[0], hp[1]); + } + return result; +} + +// Helper: bind a WorkerNode to ALL ExtraDynamicSearcher layers inside a VectorIndex. +// Calls SetWorker() which wires up append, head-sync, and remote-lock callbacks. +// All layers must have the worker bound so that AddIDCapacity (called per-layer) sees +// the correct numNodes and grows each layer's TiKVVersionMap to cover the full global +// VID space (capa * numNodes), not just this node's slice. +template +static void BindWorkerToIndex(SPANN::WorkerNode* worker, std::shared_ptr& index) { + auto* spannIndex = dynamic_cast*>(index.get()); + if (!spannIndex) return; + for (int layer = 0; ; ++layer) { + auto diskIndex = spannIndex->GetDiskIndex(layer); + if (!diskIndex) break; + auto* searcher = dynamic_cast*>(diskIndex.get()); + if (searcher) searcher->SetWorker(worker); + } +} + +// Helper: same as BindWorkerToIndex but takes a raw SPANN::Index* directly +// (for sites that have already extracted the spannIndex pointer). +template +static void BindWorkerToAllLayers(SPANN::WorkerNode* worker, SPANN::Index* spannIndex) { + if (!spannIndex) return; + for (int layer = 0; ; ++layer) { + auto diskIndex = spannIndex->GetDiskIndex(layer); + if (!diskIndex) break; + auto* searcher = dynamic_cast*>(diskIndex.get()); + if (searcher) searcher->SetWorker(worker); + } +} + +// Configuration for distributed mode, read from [Distributed] ini section. +struct DistributedConfig { + bool enabled = false; + int workerIndex = 0; // 0-based: 0 = driver (dispatcher + worker 0), 1+ = remote worker + std::string dispatcherAddr; // "host:port" + std::string workerAddrs; // "host:port,host:port,..." + std::string storeAddrs; // "addr,addr,..." + std::string pdAddrs; // "host:port,host:port,..." (per-worker PD) + + // Number of workers (for query/insert partitioning) + int GetNumWorkers() const { + if (!enabled || workerAddrs.empty()) return 1; + return (int)std::count(workerAddrs.begin(), workerAddrs.end(), ',') + 1; + } + + // Parse dispatcher address into host:port pair + std::pair GetDispatcherAddr() const { + auto hp = Helper::StrUtils::SplitString(dispatcherAddr, ":"); + if (hp.size() == 2) return {hp[0], hp[1]}; + return {"", ""}; + } + + // Get PD address for this worker (falls back to global TiKVPDAddresses) + std::string GetLocalPDAddr() const { + if (pdAddrs.empty()) return ""; + auto addrs = Helper::StrUtils::SplitString(pdAddrs, ","); + if (workerIndex < (int)addrs.size()) return addrs[workerIndex]; + return addrs[0]; + } + + static DistributedConfig FromIni(Helper::IniReader& ini) { + DistributedConfig cfg; + cfg.enabled = ini.GetParameter("Distributed", "Enabled", false); + cfg.dispatcherAddr = ini.GetParameter("Distributed", "DispatcherAddr", std::string("")); + cfg.workerAddrs = ini.GetParameter("Distributed", "WorkerAddrs", std::string("")); + cfg.storeAddrs = ini.GetParameter("Distributed", "StoreAddrs", std::string("")); + cfg.pdAddrs = ini.GetParameter("Distributed", "PDAddrs", std::string("")); + + // Worker index from env var (0 = driver, 1+ = remote worker) + const char* wiEnv = std::getenv("WORKER_INDEX"); + cfg.workerIndex = wiEnv ? std::atoi(wiEnv) : 0; + + return cfg; + } +}; + namespace SPFreshTest { SizeType N = 10000; @@ -306,13 +488,17 @@ std::shared_ptr BuildIndex(const std::string &outDirectory, std::sh template std::shared_ptr BuildLargeIndex(const std::string &outDirectory, std::string &pvecset, - std::string& pmetaset, std::string& pmetaidx, Helper::IniReader& iniReader, const std::string &distMethod = "L2", + std::string& pmetaset, std::string& pmetaidx, const std::string &distMethod = "L2", int searchthread = 2, int insertthread = 2, int layers = 1, - std::shared_ptr quantizer = nullptr, std::string quantizerFilePath = "quantizer.bin") + std::shared_ptr quantizer = nullptr, std::string quantizerFilePath = "quantizer.bin", + const std::map& ssdOverrides = {}, + bool ssdOnly = false, + SPANN::WorkerNode* p_worker = nullptr) { auto vecIndex = VectorIndex::CreateInstance(IndexAlgoType::SPANN, GetEnumValueType()); int maxthreads = std::thread::hardware_concurrency(); int postingLimit = 4 * sizeof(T); + remove((outDirectory + FolderSep + "ssdmapping_0_postings").c_str()); std::string configuration = R"( [Base] DistCalcMethod=)" + distMethod + R"( @@ -399,15 +585,29 @@ std::shared_ptr BuildLargeIndex(const std::string &outDirectory, st } } - for (const auto &sec : sections) + // Apply overrides (e.g., Storage, TiKV settings, SelectHead/BuildHead params) + for (const auto &[key, val] : ssdOverrides) { - auto params = iniReader.GetParameters(sec.c_str()); - for (const auto &[key, val] : params) - { - vecIndex->SetParameter(key.c_str(), val.c_str(), sec.c_str()); + // Keys prefixed with "SectionName." are routed to the corresponding section + auto dotPos = key.find('.'); + if (dotPos != std::string::npos) { + std::string section = key.substr(0, dotPos); + std::string param = key.substr(dotPos + 1); + vecIndex->SetParameter(param.c_str(), val.c_str(), section.c_str()); + } else { + vecIndex->SetParameter(key.c_str(), val.c_str(), "BuildSSDIndex"); } } + // SSD-only mode: skip SelectHead and BuildHead, resume from specified layer + if (ssdOnly) + { + // Allow explicit ResumeLayer from config/overrides; otherwise default to layer 0 + // (rebuild SSD for all layers, reusing existing head indexes) + int resumeLayer = 0; + vecIndex->SetParameter("ResumeLayer", std::to_string(resumeLayer).c_str(), "BuildSSDIndex"); + } + if (quantizer) { vecIndex->SetParameter("QuantizerFilePath", quantizerFilePath.c_str(), "Base"); @@ -415,6 +615,20 @@ std::shared_ptr BuildLargeIndex(const std::string &outDirectory, st vecIndex->SetQuantizerADC(false); vecIndex->SetParameter("Dim", std::to_string(quantizer->GetNumSubvectors()).c_str(), "Base"); } + + // Bind a routing worker (if any) to the freshly-created SSD searcher + // before BuildIndex runs. Build itself does not route postings any more + // (shared TiKV cluster — driver writes directly), so in buildOnly mode + // the workerPtr will simply be nullptr and this block is a no-op. + if (p_worker) { + if (auto* spannIdx = dynamic_cast*>(vecIndex.get())) { + spannIdx->SetWorker(p_worker); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "BuildLargeIndex: bound routing worker (numNodes=%d)\n", + p_worker->GetNumNodes()); + } + } + auto buildStatus = vecIndex->BuildIndex(); if (buildStatus != ErrorCode::Success) return nullptr; @@ -452,9 +666,19 @@ float Search(std::shared_ptr &vecIndex, std::shared_ptr return TestUtils::TestDataGenerator::EvaluateRecall(results, truth, k, k, batch, totalbatches); } +template +double ExecutePartitionedSearch(VectorIndex* index, + std::shared_ptr& queryset, + int myStart, int myCount, + int searchK, int numThreads, + std::vector& results, + std::vector* latenciesOut, + std::vector* statsOut); + template void InsertVectors(SPANN::Index *p_index, int insertThreads, int step, - std::shared_ptr addset, std::shared_ptr &metaset, int searchThreads = 0, std::shared_ptr queryset = nullptr, int numQueries = 0, int k = 5, std::ostream* benchmarkData = nullptr, int start = 0) + std::shared_ptr addset, std::shared_ptr &metaset, int searchThreads = 0, std::shared_ptr queryset = nullptr, int numQueries = 0, int k = 5, std::ostream* benchmarkData = nullptr, int start = 0, + SPANN::WorkerNode* router = nullptr) { p_index->ForceCompaction(); p_index->GetDBStat(); @@ -462,8 +686,15 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step std::vector threads; int printstep = step / 50; + + // Bulk path: single AddIndex call amortizes remote-append RPCs into one AppendBatchAsync. + // Per-vector RNGSelection is parallelized inside ExtraDynamicSearcher::AddIndex so we + // keep insertThreads-way parallelism while saving N-1 RPCs. + bool useBulk = (router && router->GetNumNodes() > 1); + + // Per-vector insert (original path): each thread grabs one vector at a time std::atomic_size_t vectorsSent(start); - auto func = [&]() { + auto perVecFunc = [&]() { size_t index = start; while (true) { @@ -500,43 +731,48 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step } }; - if (searchThreads > 0 && queryset != nullptr && numQueries != 0 && benchmarkData != nullptr) { - std::vector latencies(numQueries); - std::vector results(numQueries); - std::vector duration(searchThreads); - - for (int i = 0; i < numQueries; i++) + // Bulk insert (router path): single call, parallelism inside SPANNIndex::AddIndex + auto bulkFunc = [&]() { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "InsertVectors: bulk AddIndex for %d vectors (router enabled)\n", step); + ErrorCode ret = p_index->AddIndex(addset->GetVector((SizeType)start), step, addset->Dimension(), metaset, true); + if (ret != ErrorCode::Success) { - results[i] = QueryResult((const ValueType *)queryset->GetVector(i), k, false); + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "AddIndex bulk failed. start:%d count:%d Dim:%d Error:%d\n", + start, step, addset->Dimension(), static_cast(ret)); } + BOOST_REQUIRE(ret == ErrorCode::Success); + }; - std::atomic_size_t queriesSent(0); - auto search = [&](int tid) { - auto s1 = std::chrono::high_resolution_clock::now(); - size_t qid; - while ((qid = queriesSent.fetch_add(1)) < numQueries) - { - auto t1 = std::chrono::high_resolution_clock::now(); - p_index->SearchIndex(results[qid]); - auto t2 = std::chrono::high_resolution_clock::now(); - latencies[qid] = std::chrono::duration_cast(t2 - t1).count() / 1000.0f; - } - auto s2 = std::chrono::high_resolution_clock::now(); - duration[tid] = std::chrono::duration_cast(s2 - s1).count() / 1000.0f; - }; + std::function func; + int insertThreadCount; + if (useBulk) { + func = bulkFunc; + insertThreadCount = 1; + } else { + func = perVecFunc; + insertThreadCount = insertThreads; + } + + if (searchThreads > 0 && queryset != nullptr && numQueries != 0 && benchmarkData != nullptr) { + std::vector latencies; + std::vector results; + double searchWallSeconds = 0.0; - for (int j = 0; j < insertThreads; j++) + for (int j = 0; j < insertThreadCount; j++) { threads.emplace_back(func); } - for (int j = 0; j < searchThreads; j++) - { - threads.emplace_back(search, j); - } + std::thread searchThread([&]() { + searchWallSeconds = ExecutePartitionedSearch( + p_index, queryset, /*myStart=*/0, numQueries, k, searchThreads, + results, &latencies, /*statsOut=*/nullptr); + }); for (auto &thread : threads) { thread.join(); } + searchThread.join(); // Calculate statistics float mean = 0, minLat = (std::numeric_limits::max)(), maxLat = 0; @@ -553,10 +789,7 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step float p90 = latencies[static_cast(numQueries * 0.90)]; float p95 = latencies[static_cast(numQueries * 0.95)]; float p99 = latencies[static_cast(numQueries * 0.99)]; - float maxBatchLatency = 1e-6; - for (int i = 0; i < searchThreads; i++) - if (maxBatchLatency < duration[i]) maxBatchLatency = duration[i]; - float qps = numQueries / maxBatchLatency; + float qps = numQueries / std::max(static_cast(searchWallSeconds), 1e-6f); *benchmarkData << " \"numQueries\": " << numQueries << ",\n"; *benchmarkData << " \"meanLatency\": " << mean << ",\n"; @@ -567,6 +800,17 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step *benchmarkData << " \"minLatency\": " << minLat << ",\n"; *benchmarkData << " \"maxLatency\": " << maxLat << ",\n"; *benchmarkData << " \"qps\": " << qps << ",\n"; + } else { + // No search-during-insert path: just run the insert threads. + // (Used by worker dispatch and any caller that doesn't need stats.) + for (int j = 0; j < insertThreadCount; j++) + { + threads.emplace_back(func); + } + for (auto &thread : threads) + { + thread.join(); + } } auto barrierStart = std::chrono::high_resolution_clock::now(); size_t barrierPolls = 0; @@ -587,72 +831,82 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step } + + + template void BenchmarkQueryPerformance(std::shared_ptr &index, std::shared_ptr &queryset, std::shared_ptr &truth, const std::string &truthPath, SizeType baseVectorCount, int topK, int searchK, int numThreads, int numQueries, int batches, int totalbatches, - std::ostream &benchmarkData, std::string prefix = "") + std::ostream &benchmarkData, std::string prefix = "", + int nodeIndex = 0, SPANN::WorkerNode* router = nullptr, + SPANN::DispatcherNode* dispatcher = nullptr) { - // Benchmark: Query performance with detailed latency stats - std::vector latencies(numQueries); - std::atomic_size_t queriesSent(0); - std::vector results(numQueries); - std::vector searchStats(numQueries); - auto* spannIndex = dynamic_cast*>(index.get()); - - for (int i = 0; i < numQueries; i++) - { - results[i] = QueryResult((const T *)queryset->GetVector(i), searchK, false); + // Use hash ring node count (workers only) for partitioning, not GetNumNodes() (includes dispatcher) + auto ring = (router && router->IsEnabled()) ? router->GetHashRing() : nullptr; + int nodeCount = ring ? static_cast(ring->NodeCount()) : 1; + bool distributed = (dispatcher != nullptr && router != nullptr && router->IsEnabled() && nodeCount > 1); + + // Determine this node's query range (balanced contiguous partition) + int myStart = 0, myCount = numQueries; + if (distributed) { + myStart = (int)((long long)nodeIndex * numQueries / nodeCount); + int myEnd = (int)((long long)(nodeIndex + 1) * numQueries / nodeCount); + myCount = myEnd - myStart; } - std::vector threads; - threads.reserve(numThreads); - - auto batchStart = std::chrono::high_resolution_clock::now(); - - for (int i = 0; i < numThreads; i++) - { - threads.emplace_back([&]() { - size_t qid; - while ((qid = queriesSent.fetch_add(1)) < numQueries) - { - auto t1 = std::chrono::high_resolution_clock::now(); - if (spannIndex != nullptr) - { - spannIndex->SearchIndex(results[qid], &searchStats[qid]); - } - else - { - index->SearchIndex(results[qid]); - } - auto t2 = std::chrono::high_resolution_clock::now(); - latencies[qid] = std::chrono::duration_cast(t2 - t1).count() / 1000.0f; - } - }); + // Dispatch search command to all workers via TCP (distributed only) + std::int64_t dispatchId = -1; + int round = 0; + if (distributed) { + static std::atomic s_searchRound{0}; + round = s_searchRound.fetch_add(1); + dispatchId = dispatcher->BroadcastDispatchCommand( + SPANN::DispatchCommand::Type::Search, static_cast(round)); } - for (auto &thread : threads) - thread.join(); + // Run this node's share of queries. + std::vector results; + std::vector latencies; + std::vector searchStats; + double localWallTime = ExecutePartitionedSearch( + index.get(), queryset, myStart, myCount, searchK, numThreads, + results, &latencies, &searchStats); + float batchLatency = static_cast(localWallTime); + auto* spannIndex = dynamic_cast*>(index.get()); - auto batchEnd = std::chrono::high_resolution_clock::now(); - float batchLatency = - std::chrono::duration_cast(batchEnd - batchStart).count() / 1000000.0f; + if (distributed) { + // Driver also runs searches against its local node, so it can have + // outgoing merge hints queued. Drain before we move on. + if (router) { + router->FlushRemoteMerges(); + } + // Collect worker timings via TCP; QPS is governed by the slowest node. + auto workerTimes = dispatcher->WaitForAllResults(dispatchId, 300); + for (double wt : workerTimes) { + batchLatency = std::max(batchLatency, static_cast(wt)); + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "BenchmarkQueryPerformance round %d: local=%.1fms (%d queries), max=%.1fms, QPS=%.1f\n", + round, localWallTime * 1000, myCount, batchLatency * 1000, numQueries / batchLatency); + } - // Calculate statistics + // Calculate statistics (from this node's queries) + int statsCount = myCount; float mean = 0, minLat = (std::numeric_limits::max)(), maxLat = 0; - for (int i = 0; i < numQueries; i++) + for (int i = 0; i < statsCount; i++) { mean += latencies[i]; minLat = (std::min)(minLat, latencies[i]); maxLat = (std::max)(maxLat, latencies[i]); } - mean /= numQueries; + mean /= statsCount; std::sort(latencies.begin(), latencies.end()); - float p50 = latencies[static_cast(numQueries * 0.50)]; - float p90 = latencies[static_cast(numQueries * 0.90)]; - float p95 = latencies[static_cast(numQueries * 0.95)]; - float p99 = latencies[static_cast(numQueries * 0.99)]; + float p50 = latencies[static_cast(statsCount * 0.50)]; + float p90 = latencies[static_cast(statsCount * 0.90)]; + float p95 = latencies[static_cast(statsCount * 0.95)]; + float p99 = latencies[static_cast(statsCount * 0.99)]; float qps = numQueries / batchLatency; BOOST_TEST_MESSAGE(" Queries: " << numQueries); @@ -749,7 +1003,7 @@ void BenchmarkQueryPerformance(std::shared_ptr &index, std::shared_ benchmarkData << prefix << " },\n"; } - // Recall evaluation (if truth file provided) + // Recall evaluation if (!truth || truthPath.empty() || truthPath == "none") { BOOST_TEST_MESSAGE(" Recall evaluation skipped (no truth data)"); @@ -760,7 +1014,13 @@ void BenchmarkQueryPerformance(std::shared_ptr &index, std::shared_ BOOST_TEST_MESSAGE("Checking for truth file: " << truthPath); std::shared_ptr pvecset, paddvecset; - float avgRecall = TestUtils::TestDataGenerator::EvaluateRecall(results, truth, topK, searchK, batches, totalbatches); + // In distributed mode, this node only searched queries [myStart, myStart+myCount). + // Pass the global query count and this node's offset so EvaluateRecall indexes + // the truth file in global terms (BATCH > 0 reads the wrong truth rows otherwise). + int recallTotalQueries = distributed ? numQueries : -1; + int recallQueryOffset = distributed ? myStart : 0; + float avgRecall = TestUtils::TestDataGenerator::EvaluateRecall(results, truth, topK, searchK, batches, totalbatches, + recallTotalQueries, recallQueryOffset); BOOST_TEST_MESSAGE(" Recall" << topK << "@" << searchK << " = " << (avgRecall * 100.0f) << "%"); BOOST_TEST_MESSAGE(" (Evaluated on " << numQueries << " queries against base vectors)"); benchmarkData << std::fixed << std::setprecision(4); @@ -772,6 +1032,115 @@ void BenchmarkQueryPerformance(std::shared_ptr &index, std::shared_ benchmarkData << prefix << " }"; } +// Run [myStart, myStart+myCount) queries against `index` using `numThreads` workers. +// Returns wall time in seconds. Fills `results` and (when non-null) per-query +// `latenciesOut` (ms) and `statsOut` (SPANN SearchStats). When `statsOut` is +// non-null and the index is a SPANN index, the stats overload of SearchIndex +// is used; otherwise the plain SearchIndex path runs. +template +double ExecutePartitionedSearch(VectorIndex* index, + std::shared_ptr& queryset, + int myStart, int myCount, + int searchK, int numThreads, + std::vector& results, + std::vector* latenciesOut, + std::vector* statsOut) +{ + auto* spannIndex = dynamic_cast*>(index); + bool useStats = (statsOut != nullptr && spannIndex != nullptr); + + results.resize(myCount); + for (int i = 0; i < myCount; i++) { + results[i] = QueryResult((const T*)queryset->GetVector(myStart + i), searchK, false); + } + if (useStats) statsOut->assign(myCount, SPANN::SearchStats()); + if (latenciesOut) latenciesOut->assign(myCount, 0.0f); + + std::atomic_size_t queriesSent(0); + int nThreads = std::min(numThreads, std::max(myCount, 1)); + std::vector threads; + threads.reserve(nThreads); + + auto t0 = std::chrono::high_resolution_clock::now(); + for (int i = 0; i < nThreads; i++) { + threads.emplace_back([&]() { + size_t qid; + while ((qid = queriesSent.fetch_add(1)) < static_cast(myCount)) { + auto t1 = std::chrono::high_resolution_clock::now(); + if (useStats) { + spannIndex->SearchIndex(results[qid], &(*statsOut)[qid]); + } else if (spannIndex != nullptr) { + spannIndex->SearchIndex(results[qid]); + } else { + index->SearchIndex(results[qid]); + } + auto t2 = std::chrono::high_resolution_clock::now(); + if (latenciesOut) { + (*latenciesOut)[qid] = + std::chrono::duration_cast(t2 - t1).count() / 1000.0f; + } + } + }); + } + for (auto& t : threads) t.join(); + auto t3 = std::chrono::high_resolution_clock::now(); + return std::chrono::duration_cast(t3 - t0).count() / 1000000.0; +} + +ErrorCode QuantizeVectors(const std::shared_ptr& quantizer, + const std::shared_ptr& source, + ByteArray& dest); + +template +void LoadAndInsertBatch(SPANN::Index* spannIndex, + const std::string& paddset, + const std::string& paddmeta, + const std::string& paddmetaidx, + int dimension, + int insertStart, int loadCount, int perNodeBatch, + bool strideShard, int numNodes, int nodeIndex, + int numInsertThreads, + SPANN::WorkerNode* router, + std::shared_ptr quantizer, + int searchDuringInsertThreads, + std::shared_ptr queryset, + int numQueries, int searchK, + std::ostream* benchmarkData, + const char* logPrefix) +{ + auto addset = TestUtils::TestDataGenerator::LoadVectorSet(paddset, dimension, insertStart, loadCount); + if (quantizer) { + auto addFloat = ConvertToFloatVectorSet(addset); + BOOST_REQUIRE(addFloat != nullptr); + ByteArray quantizedAddBytes = + ByteArray::Alloc((size_t)addFloat->Count() * (size_t)(quantizer->GetNumSubvectors())); + BOOST_REQUIRE(QuantizeVectors(quantizer, addFloat, quantizedAddBytes) == ErrorCode::Success); + addset = std::make_shared(quantizedAddBytes, + VectorValueType::UInt8, + quantizer->GetNumSubvectors(), + addFloat->Count()); + } + auto addmetaset = TestUtils::TestDataGenerator::LoadMetadataSet(paddmeta, paddmetaidx, insertStart, loadCount); + if (strideShard) { + addset = ExtractStridedVectors(addset, numNodes, nodeIndex); + addmetaset = ExtractStridedMetadata(addmetaset, numNodes, nodeIndex); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "%s: stride-shard batchStart=%d loadCount=%d -> kept=%d (every %d-th, offset=%d)\n", + logPrefix, insertStart, loadCount, + (int)(addset ? addset->Count() : 0), numNodes, nodeIndex); + } + InsertVectors(spannIndex, numInsertThreads, perNodeBatch, + addset, addmetaset, + searchDuringInsertThreads, queryset, numQueries, searchK, + benchmarkData, 0, router); + if (router) { + router->FlushRemoteAppends(); + router->FlushRemoteMerges(); + router->LogRouteStats(" (batch flush)"); + router->ResetRouteStats(); + } +} + template void LogCheckpointLayerStats(const std::shared_ptr& index, int layers, int currentBatch, int totalBatches) { @@ -836,9 +1205,13 @@ ErrorCode QuantizeVectors(const std::shared_ptr& quantizer, template void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, const std::string &truthPath, DistCalcMethod distMethod, const std::string &indexPath, int dimension, int baseVectorCount, - int insertVectorCount, int deleteVectorCount, int batches, int topK, int numSearchThreads, int numInsertThreads, int numSearchDuringInsertThreads, int numQueries, Helper::IniReader& iniReader, + int insertVectorCount, int deleteVectorCount, int batches, int topK, int numSearchThreads, int numInsertThreads, int numSearchDuringInsertThreads, int numQueries, const std::string &outputFile = "output.json", const bool rebuild = true, const int resume = -1, - const std::string &quantizerFilePath = std::string(""), int quantizedDim = 0, int layers = 1) + const std::string &quantizerFilePath = std::string(""), int quantizedDim = 0, int layers = 1, + const std::map& ssdOverrides = {}, + bool rebuildSsdOnly = false, + bool buildOnly = false, + const DistributedConfig& distCfg = {}) { int oldM = M, oldK = K, oldN = N, oldQueries = queries; N = baseVectorCount; @@ -849,6 +1222,27 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c int insertBatchSize = insertVectorCount / max(batches, 1); int deleteBatchSize = deleteVectorCount / max(batches, 1); + // Use distributed config for multi-node partitioning + int nodeIndex = distCfg.workerIndex; + int numNodes = distCfg.GetNumWorkers(); + bool strideShard = IsStrideShardEnabled() && numNodes > 1; + int myInsertStart, myInsertEnd, perNodeBatch; + if (strideShard) { + // Stride mode: each node loads the FULL per-iter batch then keeps rows + // where (rowIdx % numNodes) == nodeIndex. myInsertStart/End span the + // full batch; perNodeBatch is the count of strided rows. + myInsertStart = 0; + myInsertEnd = insertBatchSize; + perNodeBatch = static_cast(StrideCount(insertBatchSize, numNodes, nodeIndex)); + } else { + myInsertStart = (numNodes > 1) ? (nodeIndex * insertBatchSize) / numNodes : 0; + myInsertEnd = (numNodes > 1) ? ((nodeIndex + 1) * insertBatchSize) / numNodes : insertBatchSize; + perNodeBatch = myInsertEnd - myInsertStart; + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "RunBenchmark: nodeIndex=%d numNodes=%d insertBatchSize=%d myInsertStart=%d myInsertEnd=%d perNodeBatch=%d strideShard=%d\n", + nodeIndex, numNodes, insertBatchSize, myInsertStart, myInsertEnd, perNodeBatch, strideShard ? 1 : 0); + // Variables to collect JSON output data std::ostringstream tmpbenchmark; @@ -902,12 +1296,78 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c jsonFile << " \"results\": {\n"; int SearchK = enableQuantization? topK * 4 : topK; + // Distributed routing: dispatcher + local worker (driver node is both) + std::unique_ptr dispatcher; + std::unique_ptr worker; + SPANN::WorkerNode* workerPtr = nullptr; // convenience alias std::shared_ptr index; std::shared_ptr quantizer; - + + // Distributed setup: when running a non-buildOnly distributed benchmark + // (i.e. the search/insert run phase), create the dispatcher + worker0 + // so the driver can broadcast the hash ring and accept remote callbacks. + // BuildOnly mode skips this entirely — build runs single-node and writes + // straight to the shared TiKV cluster (PD routes each key to the owning + // store), so no dispatcher / worker plumbing is needed for the build + // path. + if (distCfg.enabled && !buildOnly) { + auto dispAddr = distCfg.GetDispatcherAddr(); + auto workerAddrs = ParseNodeAddrs(distCfg.workerAddrs); + auto storeAddrs = Helper::StrUtils::SplitString(distCfg.storeAddrs, ","); + + dispatcher.reset(new SPANN::DispatcherNode()); + BOOST_REQUIRE_MESSAGE(dispatcher->Initialize(dispAddr, workerAddrs), + "DispatcherNode initialization failed (build-phase setup)"); + BOOST_REQUIRE(dispatcher->Start()); + + worker.reset(new SPANN::WorkerNode()); + // Pre-build: pass nullptr DB. After BuildIndex, swap in the real DB + // via SetDB() (or rebuild the worker on top of it for run mode). + BOOST_REQUIRE_MESSAGE( + worker->Initialize(nullptr, 0, dispAddr, workerAddrs, storeAddrs), + "WorkerNode initialization failed (build-phase setup)"); + BOOST_REQUIRE(worker->Start()); + workerPtr = worker.get(); + + dispatcher->SetLocalWorkerIndex(worker->GetLocalNodeIndex()); + worker->SetHashRing(dispatcher->GetHashRing()); + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "Pre-build: waiting for all peer connections...\n"); + BOOST_REQUIRE_MESSAGE(dispatcher->WaitForAllPeersConnected(180), + "Timed out waiting for peer connections (build-phase)"); + + auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(180); + while (std::chrono::steady_clock::now() < deadline) { + if (dispatcher->AllWorkersAcked()) break; + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + } + BOOST_REQUIRE_MESSAGE(dispatcher->AllWorkersAcked(), + "Timed out waiting for workers to ACK ring (build-phase)"); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "Pre-build: all %d workers connected and ring synchronized\n", numNodes); + + // Start heartbeat pump so remote workers can detect driver failure + // and exit cleanly instead of relying on a fixed wall-clock receiver + // timeout. Worker side enforces HeartbeatTimeoutSec (default 180s). + // Interval is fixed at 30s; six missed pings before worker bails. + dispatcher->StartHeartbeat(30); + } + // Build initial index BOOST_TEST_MESSAGE("\n=== Building Index ==="); - if (rebuild || !direxists(indexPath.c_str())) { + if (rebuild || rebuildSsdOnly || !direxists(indexPath.c_str())) { + if (!rebuildSsdOnly) { + // Allow empty or non-existent directories; block only if index files already exist + if (direxists(indexPath.c_str()) && fileexists((indexPath + FolderSep + "indexloader.ini").c_str())) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "Index directory '%s' already exists with index files. Refusing to delete. " + "Remove it manually or use RebuildSSDOnly=true to resume.\n", + indexPath.c_str()); + BOOST_FAIL("Index directory already exists: " + indexPath); + return; + } + } auto buildstart = std::chrono::high_resolution_clock::now(); if (enableQuantization) @@ -932,13 +1392,13 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c quantizedBase->Save(pquanvecset); } - index = BuildLargeIndex(indexPath, pquanvecset, pmeta, pmetaidx, iniReader, dist, numSearchThreads, numInsertThreads, layers, quantizer, "quantizer.bin"); + index = BuildLargeIndex(indexPath, pquanvecset, pmeta, pmetaidx, dist, numSearchThreads, numInsertThreads, layers, quantizer, "quantizer.bin", ssdOverrides, rebuildSsdOnly, workerPtr); BOOST_REQUIRE(index != nullptr); index->SetQuantizerADC(true); } else { - index = BuildLargeIndex(indexPath, pvecset, pmeta, pmetaidx, iniReader, dist, numSearchThreads, numInsertThreads, layers); + index = BuildLargeIndex(indexPath, pvecset, pmeta, pmetaidx, dist, numSearchThreads, numInsertThreads, layers, nullptr, "quantizer.bin", ssdOverrides, rebuildSsdOnly, workerPtr); BOOST_REQUIRE(index != nullptr); } @@ -954,6 +1414,23 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c BOOST_REQUIRE(index != nullptr); } + // Set up distributed routing for RUN mode if configured. + // (Build-phase needs no dispatcher/worker; the run-phase dispatcher+worker + // were created in the pre-build block above.) The driver node is both + // dispatcher (ring management) and worker 0 (compute). + if (distCfg.enabled && !buildOnly) { + // Bind worker to ALL searcher layers (wires append + headsync + lock + fetch callbacks). + // Every layer must see the worker so AddIDCapacity grows each layer's + // version map by capa * numNodes (not just capa). + auto* spannIndex = dynamic_cast*>(index.get()); + BOOST_REQUIRE(spannIndex != nullptr); + BindWorkerToAllLayers(workerPtr, spannIndex); + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "Run mode: worker bound to all %d layers\n", + (int)spannIndex->GetOptions()->m_layers); + } + auto queryset = TestUtils::TestDataGenerator::LoadVectorSet(pqueryset, M); BOOST_REQUIRE(queryset != nullptr); @@ -973,32 +1450,50 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c truth = TestUtils::TestDataGenerator::LoadVectorSet(ptruth, K); } - // Benchmark 0: Query performance before insertions (round 1 — cold cache) - BOOST_TEST_MESSAGE("\n=== Benchmark 0: Query Before Insertions (Round 1) ==="); - BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, - numSearchThreads, numQueries, 0, batches, tmpbenchmark); - jsonFile << " \"benchmark0_query_before_insert\": "; - BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, - numSearchThreads, numQueries, 0, batches, jsonFile); - jsonFile << ",\n"; - jsonFile.flush(); - - // Benchmark 0b: Query performance before insertions (round 2 — warm cache) - BOOST_TEST_MESSAGE("\n=== Benchmark 0b: Query Before Insertions (Round 2) ==="); - BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, - numSearchThreads, numQueries, 0, batches, tmpbenchmark); - jsonFile << " \"benchmark0b_query_before_insert_round2\": "; - BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, - numSearchThreads, numQueries, 0, batches, jsonFile); - jsonFile << ",\n"; - jsonFile.flush(); + // Benchmark 0/0b: query performance before insertions. Skip in BuildOnly + // mode (no point measuring queries when we're about to exit; queries also + // require workers to be running for distributed scatter-gather). + if (!buildOnly) { + // Benchmark 0: Query performance before insertions (round 1 — cold cache) + BOOST_TEST_MESSAGE("\n=== Benchmark 0: Query Before Insertions (Round 1) ==="); + BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, + numSearchThreads, numQueries, 0, batches, tmpbenchmark, "", + nodeIndex, workerPtr, dispatcher.get()); + jsonFile << " \"benchmark0_query_before_insert\": "; + BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, + numSearchThreads, numQueries, 0, batches, jsonFile, "", + nodeIndex, workerPtr, dispatcher.get()); + jsonFile << ",\n"; + jsonFile.flush(); + + // Benchmark 0b: Query performance before insertions (round 2 — warm cache) + BOOST_TEST_MESSAGE("\n=== Benchmark 0b: Query Before Insertions (Round 2) ==="); + BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, + numSearchThreads, numQueries, 0, batches, tmpbenchmark, "", + nodeIndex, workerPtr, dispatcher.get()); + jsonFile << " \"benchmark0b_query_before_insert_round2\": "; + BenchmarkQueryPerformance(index, queryset, truth, truthPath, baseVectorCount, topK, SearchK, + numSearchThreads, numQueries, 0, batches, jsonFile, "", + nodeIndex, workerPtr, dispatcher.get()); + jsonFile << ",\n"; + jsonFile.flush(); + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "BuildOnly=true: skipping Benchmark 0/0b query rounds\n"); + jsonFile << " \"benchmark0_query_before_insert\": {},\n"; + jsonFile << " \"benchmark0b_query_before_insert_round2\": {},\n"; + jsonFile.flush(); + } BOOST_REQUIRE(index->SaveIndex(indexPath) == ErrorCode::Success); index = nullptr; // Benchmark 1: Insert performance - if (insertBatchSize > 0) + if (buildOnly) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "BuildOnly=true: skipping insert batches, index saved to %s\n", indexPath.c_str()); + jsonFile << " \"benchmark1_insert\": {}\n"; + } + else if (insertBatchSize > 0) { BOOST_TEST_MESSAGE("\n=== Benchmark 1: Insert Performance ==="); { @@ -1076,31 +1571,53 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Cloned index from %s to %s, check:%d, time: %f seconds\n", prevPath.c_str(), clonePath.c_str(), (int)(cloneret == ErrorCode::Success), seconds); - int insertStart = iter * insertBatchSize; + // Re-bind the worker to ALL layers of the new cloned index's searchers + // (every layer must see the worker so AddIDCapacity grows each layer's + // version map by capa * numNodes). + if (workerPtr) { + BindWorkerToIndex(workerPtr, cloneIndex); + } + + // Dispatch insert command to workers via TCP + std::uint64_t insertDispatchId = 0; + if (dispatcher && numNodes > 1) { + insertDispatchId = dispatcher->BroadcastDispatchCommand( + SPANN::DispatchCommand::Type::Insert, static_cast(iter)); + } + + // Each node inserts its partition. Default mode: contiguous slice + // [iter*batchSize + myInsertStart, +perNodeBatch). Stride mode: + // every numNodes-th row of the full batch starting at nodeIndex + // (loads full batch then filters down to perNodeBatch rows). + int insertStart = iter * insertBatchSize + myInsertStart; + int loadCount = strideShard ? insertBatchSize : perNodeBatch; { - std::shared_ptr addset = TestUtils::TestDataGenerator::LoadVectorSet(paddset, M, insertStart, insertBatchSize); - ByteArray quantizedAddBytes; - if (enableQuantization) { - auto addFloat = ConvertToFloatVectorSet(addset); - BOOST_REQUIRE(addFloat != nullptr); - quantizedAddBytes = ByteArray::Alloc((size_t)addFloat->Count() * (size_t)(quantizer->GetNumSubvectors())); - BOOST_REQUIRE(QuantizeVectors(quantizer, addFloat, quantizedAddBytes) == ErrorCode::Success); - addset = std::make_shared(quantizedAddBytes, - VectorValueType::UInt8, - quantizer->GetNumSubvectors(), - addFloat->Count()); - } - std::shared_ptr addmetaset = TestUtils::TestDataGenerator::LoadMetadataSet(paddmeta, paddmetaidx, insertStart, insertBatchSize); + std::string driverTag = "RunBenchmark iter=" + std::to_string(iter); start = std::chrono::high_resolution_clock::now(); - InsertVectors(static_cast *>(cloneIndex.get()), numInsertThreads, insertBatchSize, - addset, addmetaset, numSearchDuringInsertThreads, queryset, numQueries, SearchK, &jsonFile, 0); - end = std::chrono::high_resolution_clock::now(); + LoadAndInsertBatch(static_cast*>(cloneIndex.get()), + paddset, paddmeta, paddmetaidx, M, + insertStart, loadCount, perNodeBatch, + strideShard, numNodes, nodeIndex, + numInsertThreads, workerPtr, + enableQuantization ? quantizer : nullptr, + numSearchDuringInsertThreads, queryset, + numQueries, SearchK, &jsonFile, + driverTag.c_str()); } + + // Wait for all worker nodes to finish this batch via TCP. + if (insertDispatchId > 0) { + auto workerTimes = dispatcher->WaitForAllResults(insertDispatchId, 7200); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Driver: all %d workers finished batch %d\n", + (int)workerTimes.size(), iter + 1); + } + + end = std::chrono::high_resolution_clock::now(); seconds = std::chrono::duration_cast(end - start).count() / 1000000.0f; double throughput = insertBatchSize / seconds; - BOOST_TEST_MESSAGE(" Inserted: " << insertBatchSize << " vectors"); + BOOST_TEST_MESSAGE(" Inserted: " << insertBatchSize << " vectors (" << perNodeBatch << " local)"); BOOST_TEST_MESSAGE(" Time: " << seconds << " seconds"); BOOST_TEST_MESSAGE(" Throughput: " << throughput << " vectors/sec"); @@ -1164,17 +1681,21 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c BOOST_TEST_MESSAGE("\n=== Benchmark 2: Query After Insertions and Deletions ==="); jsonFile << " \"search\":"; BenchmarkQueryPerformance(cloneIndex, queryset, truth, truthPath, baseVectorCount, topK, SearchK, numSearchThreads, - numQueries, iter + 1, batches, tmpbenchmark, " "); + numQueries, iter + 1, batches, tmpbenchmark, " ", + nodeIndex, workerPtr, dispatcher.get()); BenchmarkQueryPerformance(cloneIndex, queryset, truth, truthPath, baseVectorCount, - topK, SearchK, numSearchThreads, numQueries, iter + 1, batches, jsonFile, " "); + topK, SearchK, numSearchThreads, numQueries, iter + 1, batches, jsonFile, " ", + nodeIndex, workerPtr, dispatcher.get()); jsonFile << ",\n"; BOOST_TEST_MESSAGE("\n=== Benchmark 2b: Query After Insertions and Deletions (Round 2) ==="); jsonFile << " \"search_round2\":"; BenchmarkQueryPerformance(cloneIndex, queryset, truth, truthPath, baseVectorCount, topK, SearchK, numSearchThreads, - numQueries, iter + 1, batches, tmpbenchmark, " "); + numQueries, iter + 1, batches, tmpbenchmark, " ", + nodeIndex, workerPtr, dispatcher.get()); BenchmarkQueryPerformance(cloneIndex, queryset, truth, truthPath, baseVectorCount, - topK, SearchK, numSearchThreads, numQueries, iter + 1, batches, jsonFile, " "); + topK, SearchK, numSearchThreads, numQueries, iter + 1, batches, jsonFile, " ", + nodeIndex, workerPtr, dispatcher.get()); jsonFile << ",\n"; start = std::chrono::high_resolution_clock::now(); @@ -1223,6 +1744,18 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c jsonFile << "}\n"; jsonFile.close(); + // Stop workers in distributed mode + if (dispatcher && numNodes > 1) { + // Stop the heartbeat pump first so we don't race a stray Heartbeat + // packet against the Stop dispatch on the same connection. + dispatcher->StopHeartbeat(); + auto dispatchId = dispatcher->BroadcastDispatchCommand(SPANN::DispatchCommand::Type::Stop, 0); + // Wait briefly for ACKs so workers exit cleanly before the driver + // tears down the network (which would force-kill in-flight RPCs). + dispatcher->WaitForAllResults(dispatchId, 60); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Driver: sent Stop command to all workers\n"); + } + M = oldM; K = oldK; N = oldN; @@ -2198,6 +2731,14 @@ BOOST_AUTO_TEST_CASE(IterativeSearchPerf) std::filesystem::remove_all("original_index"); } +// Forward declaration +template +void RunWorker(const std::string& indexPath, int dimension, int baseVectorCount, + int insertVectorCount, int batches, int topK, int numSearchThreads, + int numInsertThreads, int numQueries, VectorValueType valueType, + const std::map& ssdOverrides, + const DistributedConfig& distCfg, int workerTimeout); + BOOST_AUTO_TEST_CASE(BenchmarkFromConfig) { using namespace SPFreshTest; @@ -2245,14 +2786,59 @@ BOOST_AUTO_TEST_CASE(BenchmarkFromConfig) int topK = iniReader.GetParameter("Benchmark", "TopK", 10); int numSearchThreads = iniReader.GetParameter("Benchmark", "NumSearchThreads", 8); int numInsertThreads = iniReader.GetParameter("Benchmark", "NumInsertThreads", 8); - int appendThreadNum = iniReader.GetParameter("Benchmark", "AppendThreadNum", 0); int numSearchDuringInsertThreads = iniReader.GetParameter("Benchmark", "NumSearchDuringInsertThreads", 1); + int appendThreadNum = iniReader.GetParameter("Benchmark", "AppendThreadNum", 0); int numQueries = iniReader.GetParameter("Benchmark", "NumQueries", 1000); int layers = iniReader.GetParameter("Benchmark", "Layers", 1); DistCalcMethod distMethod = iniReader.GetParameter("Benchmark", "DistMethod", DistCalcMethod::L2); - bool rebuild = (iniReader.GetParameter("Benchmark", "Rebuild", true) || iniReader.GetParameter("Benchmark", "RebuildSSDOnly", false)); + bool rebuild = iniReader.GetParameter("Benchmark", "Rebuild", true); + bool rebuildSsdOnly = iniReader.GetParameter("Benchmark", "RebuildSSDOnly", false); + bool buildOnly = iniReader.GetParameter("Benchmark", "BuildOnly", false); int resume = iniReader.GetParameter("Benchmark", "Resume", -1); + // Read storage backend overrides for BuildSSDIndex + std::map ssdOverrides; + std::string storage = iniReader.GetParameter("Benchmark", "Storage", std::string("")); + if (!storage.empty()) { + ssdOverrides["Storage"] = storage; + } + std::string tikvKeyPrefix = iniReader.GetParameter("Benchmark", "TiKVKeyPrefix", std::string("")); + if (!tikvKeyPrefix.empty()) { + ssdOverrides["TiKVKeyPrefix"] = tikvKeyPrefix; + } + if (appendThreadNum > 0) { + ssdOverrides["AppendThreadNum"] = std::to_string(appendThreadNum); + } + + // Pass through any [BuildSSDIndex] section params from the ini as overrides + auto buildSSDParams = iniReader.GetParameters("BuildSSDIndex"); + for (const auto &[key, val] : buildSSDParams) { + ssdOverrides[key] = val; + } + + // Read distributed config from [Distributed] section + auto distCfg = DistributedConfig::FromIni(iniReader); + + // Shared TiKV raft cluster: every compute node connects to the FULL PD + // endpoint list. The TiKV client uses PD-raft to route reads/writes to + // whichever store owns the region, so any compute can access any posting. + if (!distCfg.pdAddrs.empty()) { + ssdOverrides["TiKVPDAddresses"] = distCfg.pdAddrs; + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "Using PD address: %s (workerIndex=%d)\n", + distCfg.pdAddrs.c_str(), distCfg.workerIndex); + } + + // Pass through [SelectHead] and [BuildHead] params as overrides too + auto selectHeadParams = iniReader.GetParameters("SelectHead"); + for (const auto &[key, val] : selectHeadParams) { + ssdOverrides["SelectHead." + key] = val; + } + auto buildHeadParams = iniReader.GetParameters("BuildHead"); + for (const auto &[key, val] : buildHeadParams) { + ssdOverrides["BuildHead." + key] = val; + } + BOOST_TEST_MESSAGE("=== Benchmark Configuration ==="); BOOST_TEST_MESSAGE("Vector Path: " << vectorPath); BOOST_TEST_MESSAGE("Query Path: " << queryPath); @@ -2273,31 +2859,224 @@ BOOST_AUTO_TEST_CASE(BenchmarkFromConfig) BOOST_TEST_MESSAGE("QuantizedDim: " << quantizedDim); } + // Worker node path: if distributed and workerIndex > 0, run as remote worker and return + if (distCfg.enabled && distCfg.workerIndex > 0) { + int workerTimeout = iniReader.GetParameter("Benchmark", "WorkerTimeout", 3600); + BOOST_TEST_MESSAGE("Running as worker node " << distCfg.workerIndex); + if (valueType == VectorValueType::Float) + RunWorker(indexPath, dimension, baseVectorCount, insertVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numQueries, valueType, ssdOverrides, distCfg, workerTimeout); + else if (valueType == VectorValueType::Int8) + RunWorker(indexPath, dimension, baseVectorCount, insertVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numQueries, valueType, ssdOverrides, distCfg, workerTimeout); + else if (valueType == VectorValueType::UInt8) + RunWorker(indexPath, dimension, baseVectorCount, insertVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numQueries, valueType, ssdOverrides, distCfg, workerTimeout); + return; + } + // Get output file path from environment variable or use default const char *outputPath = std::getenv("BENCHMARK_OUTPUT"); std::string outputFile = outputPath ? std::string(outputPath) : "output.json"; BOOST_TEST_MESSAGE("Output File: " << outputFile); - // Dispatch to appropriate type + // Driver path (nodeIndex == 0 or single-node mode) if (valueType == VectorValueType::Float) { RunBenchmark(vectorPath, queryPath, truthPath, distMethod, indexPath, dimension, baseVectorCount, - insertVectorCount, deleteVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numSearchDuringInsertThreads, numQueries, iniReader, - outputFile, rebuild, resume, quantizerFilePath, quantizedDim, layers); + insertVectorCount, deleteVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numSearchDuringInsertThreads, numQueries, outputFile, + rebuild, resume, quantizerFilePath, quantizedDim, layers, ssdOverrides, rebuildSsdOnly, buildOnly, distCfg); } else if (valueType == VectorValueType::Int8) { RunBenchmark(vectorPath, queryPath, truthPath, distMethod, indexPath, dimension, baseVectorCount, - insertVectorCount, deleteVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numSearchDuringInsertThreads, numQueries, iniReader, - outputFile, rebuild, resume, quantizerFilePath, quantizedDim, layers); + insertVectorCount, deleteVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numSearchDuringInsertThreads, numQueries, + outputFile, rebuild, resume, quantizerFilePath, quantizedDim, layers, ssdOverrides, rebuildSsdOnly, buildOnly, distCfg); } else if (valueType == VectorValueType::UInt8) { RunBenchmark(vectorPath, queryPath, truthPath, distMethod, indexPath, dimension, baseVectorCount, - insertVectorCount, deleteVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numSearchDuringInsertThreads, numQueries, iniReader, - outputFile, rebuild, resume, quantizerFilePath, quantizedDim, layers); + insertVectorCount, deleteVectorCount, batchNum, topK, numSearchThreads, numInsertThreads, numSearchDuringInsertThreads, numQueries, + outputFile, rebuild, resume, quantizerFilePath, quantizedDim, layers, ssdOverrides, rebuildSsdOnly, buildOnly, distCfg); + } +} + +/// Worker node path for distributed benchmark (nodeIndex > 0). +/// Loads a pre-built head index, connects to TiKV, starts WorkerNode, +/// and waits for TCP dispatch commands from the driver node. +template +void RunWorker(const std::string& indexPath, int dimension, int baseVectorCount, + int insertVectorCount, int batches, int topK, int numSearchThreads, + int numInsertThreads, int numQueries, VectorValueType valueType, + const std::map& ssdOverrides, + const DistributedConfig& distCfg, int workerTimeout) +{ + int oldN = N, oldM = M, oldK = K, oldQ = queries; + N = baseVectorCount; M = dimension; K = topK; queries = numQueries; + + int nodeIndex = distCfg.workerIndex; + int numNodes = distCfg.GetNumWorkers(); + int insertBatchSize = insertVectorCount / std::max(batches, 1); + bool strideShard = IsStrideShardEnabled() && numNodes > 1; + int myInsertStart, myInsertEnd, perNodeBatch; + if (strideShard) { + myInsertStart = 0; + myInsertEnd = insertBatchSize; + perNodeBatch = static_cast(StrideCount(insertBatchSize, numNodes, nodeIndex)); + } else { + myInsertStart = (numNodes > 1) ? (nodeIndex * insertBatchSize) / numNodes : 0; + myInsertEnd = (numNodes > 1) ? ((nodeIndex + 1) * insertBatchSize) / numNodes : insertBatchSize; + perNodeBatch = myInsertEnd - myInsertStart; + } + + BOOST_TEST_MESSAGE("Worker node " << nodeIndex << ": Loading index from " << indexPath); + std::shared_ptr index; + // IMPORTANT: Pass ssdOverrides through LoadIndex so that worker-specific settings + // (especially TiKVPDAddresses pointing at this worker's local PD) are applied + // BEFORE the underlying TiKV connection is constructed in PrepareDB. Without this, + // the worker would inherit the driver's PD address from the saved indexloader.ini + // and route every KV write back to the driver's TiKV instead of its own. + BOOST_REQUIRE(VectorIndex::LoadIndex(indexPath, ssdOverrides, index) == ErrorCode::Success); + BOOST_REQUIRE(index != nullptr); + + // Create WorkerNode + auto dispAddr = distCfg.GetDispatcherAddr(); + auto workerAddrs = ParseNodeAddrs(distCfg.workerAddrs); + auto storeAddrs = Helper::StrUtils::SplitString(distCfg.storeAddrs, ","); + + auto* spannIndex = dynamic_cast*>(index.get()); + BOOST_REQUIRE_MESSAGE(spannIndex != nullptr, "Failed to cast to SPANN::Index"); + auto diskIndex = spannIndex->GetDiskIndex(0); + BOOST_REQUIRE(diskIndex != nullptr); + auto* searcher = dynamic_cast*>(diskIndex.get()); + BOOST_REQUIRE(searcher != nullptr); + auto workerDb = searcher->GetDB(); + BOOST_REQUIRE_MESSAGE(workerDb != nullptr, "Worker: could not extract db from index"); + + SPANN::WorkerNode workerNode; + BOOST_REQUIRE_MESSAGE(workerNode.Initialize(workerDb, nodeIndex, dispAddr, workerAddrs, storeAddrs), + "WorkerNode initialization failed"); + BOOST_REQUIRE(workerNode.Start()); + auto* router = &workerNode; + + // Bind worker to ALL searcher layers (every layer must see the worker so + // AddIDCapacity grows each layer's version map by capa * numNodes). + BindWorkerToAllLayers(router, spannIndex); + + // Wait for ring from dispatcher + BOOST_REQUIRE_MESSAGE(router->WaitForRing(120), + "Worker: Timed out waiting for ring from dispatcher"); + + BOOST_TEST_MESSAGE("Worker " << nodeIndex << ": Ready, numNodes=" << numNodes + << " perNodeBatch=" << perNodeBatch); + + // Build data file names + std::string typeStr = Helper::Convert::ConvertToString(valueType); + std::string paddset = "perftest_addvector.bin." + typeStr + "_" + std::to_string(insertVectorCount) + "_" + std::to_string(dimension); + std::string paddmeta = "perftest_addmeta.bin." + std::to_string(baseVectorCount) + "_" + std::to_string(insertVectorCount); + std::string paddmetaidx = "perftest_addmetaidx.bin." + std::to_string(baseVectorCount) + "_" + std::to_string(insertVectorCount); + + // Load query set + int searchK = topK; + std::string pqueryset = "perftest_query.bin." + typeStr + "_" + std::to_string(numQueries) + "_" + std::to_string(dimension); + auto queryset = TestUtils::TestDataGenerator::LoadVectorSet(pqueryset, dimension); + BOOST_REQUIRE_MESSAGE(queryset != nullptr, "Worker: Failed to load query set from " << pqueryset); + + // Register dispatch callback + std::promise stopPromise; + auto stopFuture = stopPromise.get_future(); + std::once_flag stopOnce; + + router->SetDispatchCallback([&](const SPANN::DispatchCommand& cmd) -> SPANN::DispatchResult { + SPANN::DispatchResult result; + result.m_dispatchId = cmd.m_dispatchId; + result.m_round = cmd.m_round; + + if (cmd.m_type == SPANN::DispatchCommand::Type::Stop) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Stop command received\n", nodeIndex); + std::call_once(stopOnce, [&]() { stopPromise.set_value(); }); + result.m_status = SPANN::DispatchResult::Status::Success; + return result; + } + + if (cmd.m_type == SPANN::DispatchCommand::Type::Heartbeat) { + // Driver sends a Heartbeat every HeartbeatIntervalSec; the result + // is dropped by DispatchCoordinator. Acknowledge silently so we + // don't log noise every 30s during the insert phase. + result.m_status = SPANN::DispatchResult::Status::Success; + return result; + } + + if (cmd.m_type == SPANN::DispatchCommand::Type::Search) { + int myStart = (int)((long long)nodeIndex * numQueries / numNodes); + int myEnd = (int)((long long)(nodeIndex + 1) * numQueries / numNodes); + int myCount = myEnd - myStart; + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Search round %u - %d queries [%d, %d)\n", + nodeIndex, cmd.m_round, myCount, myStart, myEnd); + + std::vector results; + double wallTime = ExecutePartitionedSearch( + index.get(), queryset, myStart, myCount, searchK, + std::min(numSearchThreads, myCount), + results, /*latenciesOut=*/nullptr, /*statsOut=*/nullptr); + + // Drain merge hints accumulated during this search round. + // Search-side AsyncMergeInSearch on remote-owned heads enqueues + // notifications via QueueRemoteMerge; auto-flush only fires when + // a per-target bucket reaches kMergeAutoFlushThreshold, so the + // tail of every round (and any sparse rounds) needs an explicit + // drain to guarantee no hint is dropped. + router->FlushRemoteMerges(); + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Search round %u done - %.1fms\n", + nodeIndex, cmd.m_round, wallTime * 1000); + result.m_status = SPANN::DispatchResult::Status::Success; + result.m_wallTime = wallTime; + return result; + } + + if (cmd.m_type == SPANN::DispatchCommand::Type::Insert) { + int insertStart = cmd.m_round * insertBatchSize + myInsertStart; + int loadCount = strideShard ? insertBatchSize : perNodeBatch; + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Batch %u - inserting %d vectors (offset %d, strideShard=%d)\n", + nodeIndex, cmd.m_round + 1, perNodeBatch, insertStart, strideShard ? 1 : 0); + + auto t1 = std::chrono::high_resolution_clock::now(); + std::string workerTag = + "Worker " + std::to_string(nodeIndex) + " batch=" + std::to_string(cmd.m_round + 1); + LoadAndInsertBatch(spannIndex, paddset, paddmeta, paddmetaidx, dimension, + insertStart, loadCount, perNodeBatch, + strideShard, numNodes, nodeIndex, + numInsertThreads, router, + /*quantizer=*/nullptr, + /*searchDuringInsertThreads=*/0, + /*queryset=*/nullptr, + /*numQueries=*/0, /*searchK=*/5, + /*benchmarkData=*/nullptr, + workerTag.c_str()); + auto t2 = std::chrono::high_resolution_clock::now(); + double secs = std::chrono::duration_cast(t2 - t1).count() / 1000000.0; + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Batch %u done - %d vectors in %.2f s (%.1f vec/s)\n", + nodeIndex, cmd.m_round + 1, perNodeBatch, secs, perNodeBatch / secs); + + result.m_status = SPANN::DispatchResult::Status::Success; + result.m_wallTime = secs; + return result; + } + + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Worker %d: Unknown command type %d\n", + nodeIndex, (int)cmd.m_type); + result.m_status = SPANN::DispatchResult::Status::Failed; + return result; + }); + + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Waiting for dispatch commands\n", nodeIndex); + + auto status = stopFuture.wait_for(std::chrono::seconds(workerTimeout)); + if (status == std::future_status::timeout) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Worker %d: Timeout after %ds\n", nodeIndex, workerTimeout); } - //std::filesystem::remove_all(indexPath); + router->ClearDispatchCallback(); + N = oldN; M = oldM; K = oldK; queries = oldQ; + BOOST_TEST_MESSAGE("Worker " << nodeIndex << ": Shutting down"); } BOOST_AUTO_TEST_SUITE_END() diff --git a/Test/src/TestDataGenerator.cpp b/Test/src/TestDataGenerator.cpp index cb3318548..c32f19e0a 100644 --- a/Test/src/TestDataGenerator.cpp +++ b/Test/src/TestDataGenerator.cpp @@ -274,7 +274,8 @@ void TestDataGenerator::GenerateBatchTruth(const std::string &filename, std:: } template -float TestDataGenerator::EvaluateRecall(const std::vector &res, std::shared_ptr &truth, int recallK, int k, int batch, int totalbatches) +float TestDataGenerator::EvaluateRecall(const std::vector &res, std::shared_ptr &truth, int recallK, int k, int batch, int totalbatches, + int totalQueries, int queryOffset) { if (!truth) { @@ -285,14 +286,17 @@ float TestDataGenerator::EvaluateRecall(const std::vector recallK = min(recallK, static_cast(truth->Dimension())); float totalRecall = 0.0f; float eps = 1e-4f; - SizeType distbase = truth->Count() - (totalbatches + 1) * res.size(); + // Use global queryCount when caller provides it (distributed path); otherwise + // assume single-node where res.size() IS the global query count. + SizeType queryCount = (totalQueries > 0) ? static_cast(totalQueries) : static_cast(res.size()); + SizeType distbase = truth->Count() - (totalbatches + 1) * queryCount; for (SizeType i = 0; i < res.size(); ++i) { - const SizeType *truthNN = reinterpret_cast(truth->GetData()) + batch * res.size() + i; + const SizeType *truthNN = reinterpret_cast(truth->GetVector(batch * queryCount + queryOffset + i)); float *truthD = nullptr; if (truth->Count() > distbase) { - truthD = reinterpret_cast(truth->GetVector(distbase + batch * res.size() + i)); + truthD = reinterpret_cast(truth->GetVector(distbase + batch * queryCount + queryOffset + i)); } for (int j = 0; j < recallK; ++j) { diff --git a/Test/src/main.cpp b/Test/src/main.cpp index c1a5cde60..ab8d1342c 100644 --- a/Test/src/main.cpp +++ b/Test/src/main.cpp @@ -7,9 +7,7 @@ #include #include -#ifdef TIKV #include -#endif using namespace boost::unit_test; @@ -38,9 +36,8 @@ struct GlobalFixture // adds GraphCycles bookkeeping under a global spinlock on every Lock(); // observed to consume ~12% CPU under high worker-thread parallelism in // gRPC client paths (perf-recorded 2026-05-06). -#ifdef TIKV - absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore); -#endif + absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore); + SPTAGVisitor visitor; traverse_test_tree(framework::master_test_suite(), visitor, false); } diff --git a/benchmark.ini b/benchmark.ini new file mode 100644 index 000000000..e2b400767 --- /dev/null +++ b/benchmark.ini @@ -0,0 +1,19 @@ +[Benchmark] +VectorPath=sift1b/base.100M.u8bin +QueryPath=sift1b/query.public.10K.u8bin +TruthPath=none +IndexPath=proidx/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=10000 +InsertVectorCount=10000 +DeleteVectorCount=0 +BatchNum=10 +TopK=5 +NumThreads=8 +NumQueries=100 +DistMethod=L2 +Rebuild=true +Resume=-1 +QuantizerFilePath=quantizer.bin +QuantizedDim=64 diff --git a/evaluation/distributed/README.md b/evaluation/distributed/README.md new file mode 100644 index 000000000..1f24bc865 --- /dev/null +++ b/evaluation/distributed/README.md @@ -0,0 +1,294 @@ +# Distributed Benchmark Evaluation — Insert Dominant + +Multi-machine SPTAG SPANN distributed benchmark for an **insert-dominant** workload +(1M base + 10M inserts in 10 batches, with concurrent search-during-insert) on +SIFT1B. Each physical node runs its own independent PD + TiKV (no shared Raft +replication — see "TiKV deployment model" below). + +## Files in this folder + +| File | Purpose | +| --- | --- | +| `configs/benchmark_insert_dominant_template.ini` | Benchmark template; `run_distributed.sh` fills `IndexPath`, `TiKVPDAddresses`, `TiKVKeyPrefix`, and `[Distributed]` from `cluster.conf`. | +| `run_distributed.sh` | Orchestrator: `deploy` / `start-tikv` / `run` / `stop-tikv` / `cleanup`. | +| `README.md` | This file. | + +## Architecture + +``` + ┌──────────────┐ + │ Driver │ (node 0) + │ RunBenchmark│ + │ + Router │ + └──┬───┬───┬──┘ + TCP Dispatch│ │ │ + ┌────────┘ │ └────────┐ + ▼ ▼ ▼ + ┌──────────┐ ┌──────────┐ ┌──────────┐ + │ Worker 1 │ │ Worker 2 │ │ Worker N │ + │ + Router│ │ + Router│ │ + Router│ + └────┬─────┘ └────┬─────┘ └────┬─────┘ + │ │ │ + ▼ ▼ ▼ + ┌──────────┐ ┌──────────┐ ┌──────────┐ + │ TiKV 1 │ │ TiKV 2 │ │ TiKV N │ (one PD + one TiKV per node) + └──────────┘ └──────────┘ └──────────┘ +``` + +- **Driver** (node 0): Builds the index, sends Search/Insert/Stop commands via TCP dispatch. +- **Workers** (nodes 1..N): Receive commands, execute their shard locally, report results back. +- **TiKV (per node)**: Each node runs its own independent PD + TiKV pair. Postings + for a head live on the node that owns that head's hash partition. +- **PostingRouter**: Hash-based head routing, remote append, head sync, dispatch protocol. + +## TiKV deployment model + +Unlike a single-machine multi-docker TiKV (3 PD + 3 TiKV behind 127.0.0.1 ports +22791-3 / 20161-3 sharing one Raft cluster), in this multi-machine setup **each +node runs its own isolated PD + TiKV pair** under host networking. Heads are +routed to nodes by hash, and each node's TiKV stores only its own shard. There +is no Raft replication between nodes (no cross-node region quorum), which is +intentional for insert-dominated benchmarks where Raft log overhead would dominate. + +Per-node ports (defaults from `cluster.conf`): + +| Service | Port | Notes | +| --- | --- | --- | +| PD client | `2379` | Local app uses `:2379`. | +| PD peer | `2380` | Inter-PD; isolated cluster of 1 PD per node. | +| TiKV client | `20161` | The node-local SPTAG worker connects here. | +| Router | `30001+` | TCP dispatch / posting routing between nodes. | + +## Prerequisites + +- `Release/SPTAGTest` built with TiKV support on the driver node: + ```bash + cd + cd ThirdParty/kvproto && ./generate_cpp.sh && cd ../.. + mkdir -p Release && cd Release + cmake .. -DTIKV=ON -DTBB=ON -DCMAKE_BUILD_TYPE=Release -DGPU=OFF + cmake --build . --target SPTAGTest -j$(nproc) + ``` + *Note: building the full project may fail on the Java wrapper (`JAVASPTAGFileIO`) + due to a pre-existing `FileIOInterface.h` signature mismatch — the `SPTAGTest` + target alone is sufficient.* +- Passwordless SSH from driver to every other node (configure `ssh_key` in `cluster.conf`). +- Docker installed on every node (TiKV/PD run as containers in host network mode). +- Same dataset path on every node (default `/mnt/nvme/sift1b/`): + - `/mnt/nvme/sift1b/bigann_base.u8bin` (1B × 128 × u8) + - `/mnt/nvme/sift1b/query.10K.u8bin` +- Same fast-storage path for index + TiKV data on every node (`data_dir` in `cluster.conf`, + default `/mnt/nvme`). + +## Step 1 — Cluster config + +```bash +cp evaluation/distributed/cluster.conf.example cluster.conf +vim cluster.conf +``` + +Example: + +```ini +[cluster] +ssh_user=superbench +sptag_dir=/home/superbench/zhangt/SPTAG +data_dir=/mnt/nvme +tikv_version=v7.5.1 +pd_version=v7.5.1 + +[nodes] +# host router_port +10.0.1.1 30001 # driver (always first) +10.0.1.2 30002 # worker 1 +10.0.1.3 30003 # worker 2 + +[tikv] +# host pd_client pd_peer tikv_port +10.0.1.1 2379 2380 20161 +10.0.1.2 2379 2380 20161 +10.0.1.3 2379 2380 20161 +``` + +`run_distributed.sh` reads this file to fill the template's `[Distributed]`, +`TiKVPDAddresses`, `IndexPath`, and `TiKVKeyPrefix` automatically. + +## Step 2 — Deploy + +```bash +./evaluation/distributed/run_distributed.sh deploy cluster.conf +``` + +This rsyncs `Release/SPTAGTest` (and required shared libs) to every node and +ensures the per-node TiKV / PD data directories exist under `data_dir`. + +## Step 3 — Start TiKV (per-node, independent) + +```bash +./evaluation/distributed/run_distributed.sh start-tikv cluster.conf +``` + +This starts one PD + one TiKV per node in host-network containers. Single-replica +placement (`max-replicas=1`) is set so we measure benchmark performance without +3-way Raft replication. + +Health check (run on driver, repeat per node): + +```bash +for ip in 10.0.1.1 10.0.1.2 10.0.1.3; do + curl -s "http://$ip:2379/pd/api/v1/stores" \ + | python3 -c 'import json,sys; print([s["store"]["state_name"] for s in json.load(sys.stdin)["stores"]])' +done +# Each node should report ['Up']. +``` + +### Pre-split & scatter (optional but recommended) + +For the insert-dominant workload to spread region writes evenly across regions +within a node's TiKV, pre-split the keyspace at boundaries derived from +`DBKey(headID) = MaxID*layer + headID` little-endian byte 0. The TiKV raw key is +`TiKVKeyPrefix + "_" + uint32_le(DBKey)`; for multi-chunk it appends `\x00` / +`\x02` for chunk / count keys, but we split *only* on the head-key prefix so all +chunk and count variants for a head share a region. Boundaries used: `0x02, 0x04, +…, 0xfe` (127 split points → 128 regions). + +Driver-side helper (each PD is independent, so run per node): + +```bash +PREFIX="bench_insert_dominant_3node" # keep in sync with KEY_PREFIX in run_distributed.sh +for ip in 10.0.1.1 10.0.1.2 10.0.1.3; do + PD="http://$ip:2379" + PDCTL=(docker run --rm --network host --entrypoint /pd-ctl pingcap/pd:v7.5.1 -u "$PD") + python3 - "$PREFIX" "${PDCTL[@]}" <<'PY' +import json, subprocess, sys +prefix = sys.argv[1].encode() + b'_' +pdctl = sys.argv[2:] +def run(args): return subprocess.check_output(pdctl + args, text=True) +def region_for(hex_key): return json.loads(run(['region', 'key', '--format=hex', hex_key]))['id'] +for b in range(2, 256, 2): + key = (prefix + bytes([b, 0, 0, 0])).hex() + rid = region_for(key) + run(['operator', 'add', 'split-region', str(rid), '--policy=usekey', '--keys', key]) +for r in json.loads(run(['region', 'scan']))['regions']: + run(['operator', 'add', 'scatter-region', str(r['id'])]) +PY +done +``` + +Skip this on the very first run if you don't have load skew — `start-tikv` works +without it. For 1B-scale insert-dominant runs on a single node it materially +reduces head-region hot-spotting. + +## Step 4 — Run the benchmark + +```bash +# Single scale, explicit node count (driver + (N-1) workers): +./evaluation/distributed/run_distributed.sh run cluster.conf insert_dominant 3 + +# Or sweep 1-node baseline + N-node distributed for one or more scales: +./evaluation/distributed/run_distributed.sh bench cluster.conf insert_dominant +``` + +What `run` does: + +1. **Build** (driver only): driver builds the index locally with router + *disabled* (`Rebuild=true`, no `[Router]`). Output goes to `…_n0/spann_index`. +2. **Distribute**: rsync head index + perftest files from driver to each worker. +3. **Workers**: SSH-launches `SPTAGTest` on each worker with `WORKER_INDEX=i` and + the per-node ini (router enabled, `Rebuild=false`). +4. **Driver**: relaunches `SPTAGTest` with router enabled, `Rebuild=false`. The + driver dispatches Insert / Search commands across batches via TCP. +5. **Collect**: driver sends Stop, joins worker logs into `benchmark_logs/`. + +Useful environment overrides (see header of `run_distributed.sh`): + +- `NOCACHE=1` — disable TiKV block cache, OS pagecache, and `VersionCacheMaxChunks`. +- `BUILD_WITH_CACHE=1` — build with caches, then drop caches before search/insert (NOCACHE only). +- `SKIP_TIKV_SWAP=1` — when using `BUILD_WITH_CACHE`, skip the destructive TiKV + container restart that has corrupted recall at 100M scale. +- `SKIP_SAVE_LOAD=1` — skip post-build SaveIndex / per-batch Load+Clone+Save (NOCACHE only). +- `SKIP_HEAD_BUILD=1` — reuse existing HeadIndex if present (RebuildSSDOnly). + +## Step 5 — Stop / cleanup + +```bash +./evaluation/distributed/run_distributed.sh stop-tikv cluster.conf +./evaluation/distributed/run_distributed.sh cleanup cluster.conf # remove deployed files +``` + +## Key knobs in `benchmark_insert_dominant_template.ini` + +| Key | Value | Meaning | +| --- | --- | --- | +| `BaseVectorCount` | 1_000_000 | Initial index build size. | +| `InsertVectorCount` / `BatchNum` | 10_000_000 / 10 | 10 batches × 1M inserts. | +| `NumSearchThreads` | 4 | Threads for the standalone post-batch query benchmark. | +| `NumInsertThreads` | 16 | Threads driving `AddIndex` calls on the driver. | +| `AppendThreadNum` | 144 | Async append worker pool size — overprovisioned (≈3× cores) because each thread is I/O-bound on TiKV RPCs, so high concurrency increases in-flight RPCs. | +| `NumSearchDuringInsertThreads` | 1 | Concurrent search threads while inserting (continuous loop, ~1s sleep per query). | +| `NumQueries` | 200 | Size of the rotating query pool (in-insert search loops over it). | +| `WorkerTimeout` | 14400 | Seconds a worker waits for the driver before exiting. | +| `Storage` / `TiKVKeyPrefix` / `TiKVPDAddresses` | `TIKVIO` / filled / filled | Filled by `run_distributed.sh` from `cluster.conf`. | +| `Layers` | 2 | SPANN multi-layer head. | +| `BuildSSDIndex.UseMultiChunkPosting` | false | Single-key posting layout (one TiKV value per head). | +| `BuildSSDIndex.PostingPageLimit` | 8 | Posting page limit; runtime cap is logged as ~246 vectors. | +| `BuildSSDIndex.PostingCountCacheCapacity` | 1_000_000 | Posting-count cache capacity. | +| `BuildSSDIndex.DistributedVersionMap` | true | Use TiKV-backed distributed version map. | +| `BuildSSDIndex.ReassignK` | 64 | Split/reassign target fanout knob. | +| `BuildSSDIndex.AsyncMergeInSearch` | true | Async merge during search. | +| `BuildSSDIndex.VersionCacheMaxChunks` | 100_000 | Local version-chunk cache (set ≤0 to disable). | +| `BuildSSDIndex.LatencyLimit` | 100 | ms latency cap fed to SPANN. | +| `BuildSSDIndex.MaxCheck` | 8192 | Max posting checks per query. | +| `BuildSSDIndex.SearchInternalResultNum` | 64 | Internal candidate count during search. | + +## Output JSON structure (per batch) + +For each insert batch, `output.json/results.benchmark1_insert.batch_N` contains: + +- `Load timeSeconds` / `Load vectorCount` — reload of previous batch. +- `Clone timeSeconds`. +- In-insert concurrent search stats (continuous-loop variant): + `numQueries` (actual count issued), `meanLatency`, `p50/p90/p95/p99`, `qps`, + `batch barrier waitSeconds`. +- `inserted`, `insert timeSeconds`, `insert throughput`. +- `search` and `search_round2` — standalone `BenchmarkQueryPerformance` results + against the post-batch index (cold + warm), independent of the in-insert numbers. +- `save timeSeconds`. + +Pre-insert baseline lives at `results.benchmark0_query_before_insert` and +`results.benchmark0b_query_before_insert_round2`. + +## Dispatch Protocol + +The TCP dispatch protocol replaces file-based barriers. Communication flows through +PostingRouter's existing TCP transport: + +| Packet | Direction | Purpose | +|--------|-----------|---------| +| `DispatchCommand (0x09)` | Driver → Worker | Search/Insert/Stop with `dispatchId` + round. | +| `DispatchResult (0x89)` | Worker → Driver | Status + wallTime for aggregation. | + +- **Search**: Driver broadcasts to workers, runs local queries in parallel, collects + wall times for percentile stats. +- **Insert**: Driver broadcasts batch index, workers insert their shard, driver + waits for all to finish. +- **Stop**: Driver sends at end of benchmark; workers exit gracefully. + +Each command has a unique `dispatchId` (monotonic uint64) to avoid round collisions +between search and insert operations. + +## Troubleshooting + +- **Workers don't connect**: confirm `RouterNodeAddrs` ports (default 30001+) are + reachable between every pair of nodes — the router uses TCP with 2 io_context + threads. +- **TiKV timeout**: ensure each node's PD `advertise-client-urls` use a reachable + IP (not 127.0.0.1) — `start-tikv` sets this from `cluster.conf`. Check + `docker logs sptag-pd-0` on the affected node. +- **Worker exits prematurely**: check the worker logs in `benchmark_logs/`. + Common causes: TiKV not ready, index path mismatch, router connection failure. +- **Build fails on Java wrapper**: pre-existing issue unrelated to the benchmark. + Build only what's needed: + ```bash + cmake --build . --target SPTAGTest -j$(nproc) + ``` diff --git a/evaluation/distributed/configs/benchmark_100m_1node.ini b/evaluation/distributed/configs/benchmark_100m_1node.ini new file mode 100644 index 000000000..42ec07f49 --- /dev/null +++ b/evaluation/distributed/configs/benchmark_100m_1node.ini @@ -0,0 +1,71 @@ +; 100m: 99M base + 1M insert (insert is ~1% of base, "freshness / steady-state" workload). +; 100× larger base index than insert_dominant. Tests how the system behaves when +; the head index is large (~tens of millions of heads on layer 0) and the insert +; rate is moderate. Layers=2, L2 distance, SIFT1B dataset. +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +; +; Notes for 100M-scale operation: +; - First run MUST build the index (Rebuild=true). Build of 99M base takes hours; +; reuse with Rebuild=false on subsequent runs and SKIP_HEAD_BUILD=1 if the +; HeadIndex on disk is intact. +; - Truth (top-5 over 99M) is recomputed at start each run; expect ~minutes. +; - SaveIndex at 100M has been observed to hang in BG-job-drain on some hosts; +; use SKIP_SAVE_LOAD=1 when iterating to bypass the per-batch save/load cycle. +; - TiKV data will grow to ~50-100GB per store at this scale; both nodes need +; plenty of NVMe headroom (verified: driver has 6.2T, worker has 691G). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=/mnt/nvme/proidx_100m_1node/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=99000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=true +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=bench100m_1node + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=10000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=1000000 +AsyncRpcMaxInflight=512 + +[Distributed] +Enabled=true +DispatcherAddr=10.11.0.7:30001 +WorkerAddrs=10.11.0.7:30011 +StoreAddrs=10.11.0.7:20171 +PDAddrs=10.11.0.7:23791 diff --git a/evaluation/distributed/configs/benchmark_100m_2node.ini b/evaluation/distributed/configs/benchmark_100m_2node.ini new file mode 100644 index 000000000..01b9c3e81 --- /dev/null +++ b/evaluation/distributed/configs/benchmark_100m_2node.ini @@ -0,0 +1,71 @@ +; 100m: 99M base + 1M insert (insert is ~1% of base, "freshness / steady-state" workload). +; 100× larger base index than insert_dominant. Tests how the system behaves when +; the head index is large (~tens of millions of heads on layer 0) and the insert +; rate is moderate. Layers=2, L2 distance, SIFT1B dataset. +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +; +; Notes for 100M-scale operation: +; - First run MUST build the index (Rebuild=true). Build of 99M base takes hours; +; reuse with Rebuild=false on subsequent runs and SKIP_HEAD_BUILD=1 if the +; HeadIndex on disk is intact. +; - Truth (top-5 over 99M) is recomputed at start each run; expect ~minutes. +; - SaveIndex at 100M has been observed to hang in BG-job-drain on some hosts; +; use SKIP_SAVE_LOAD=1 when iterating to bypass the per-batch save/load cycle. +; - TiKV data will grow to ~50-100GB per store at this scale; both nodes need +; plenty of NVMe headroom (verified: driver has 6.2T, worker has 691G). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=/mnt/nvme/proidx_100m_2node/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=99000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=false +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=bench100m_2node + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=10000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=1000000 +AsyncRpcMaxInflight=512 + +[Distributed] +Enabled=true +DispatcherAddr=10.11.0.7:30001 +WorkerAddrs=10.11.0.7:30011,10.11.0.10:30002 +StoreAddrs=10.11.0.7:20171,10.11.0.10:20171 +PDAddrs=10.11.0.7:23791,10.11.0.10:23791 diff --git a/evaluation/distributed/configs/benchmark_100m_template.ini b/evaluation/distributed/configs/benchmark_100m_template.ini new file mode 100644 index 000000000..4a69f39a4 --- /dev/null +++ b/evaluation/distributed/configs/benchmark_100m_template.ini @@ -0,0 +1,71 @@ +; 100m: 99M base + 1M insert (insert is ~1% of base, "freshness / steady-state" workload). +; 100× larger base index than insert_dominant. Tests how the system behaves when +; the head index is large (~tens of millions of heads on layer 0) and the insert +; rate is moderate. Layers=2, L2 distance, SIFT1B dataset. +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +; +; Notes for 100M-scale operation: +; - First run MUST build the index (Rebuild=true). Build of 99M base takes hours; +; reuse with Rebuild=false on subsequent runs and SKIP_HEAD_BUILD=1 if the +; HeadIndex on disk is intact. +; - Truth (top-5 over 99M) is recomputed at start each run; expect ~minutes. +; - SaveIndex at 100M has been observed to hang in BG-job-drain on some hosts; +; use SKIP_SAVE_LOAD=1 when iterating to bypass the per-batch save/load cycle. +; - TiKV data will grow to ~50-100GB per store at this scale; both nodes need +; plenty of NVMe headroom (verified: driver has 6.2T, worker has 691G). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=PLACEHOLDER +ValueType=UInt8 +Dimension=128 +BaseVectorCount=99000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=true +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=PLACEHOLDER + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=10000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=1000000 +AsyncRpcMaxInflight=512 + +[Distributed] +Enabled=true +DispatcherAddr=PLACEHOLDER +WorkerAddrs=PLACEHOLDER +StoreAddrs=PLACEHOLDER +PDAddrs=PLACEHOLDER diff --git a/evaluation/distributed/configs/benchmark_10m_1node.ini b/evaluation/distributed/configs/benchmark_10m_1node.ini new file mode 100644 index 000000000..56dbd9088 --- /dev/null +++ b/evaluation/distributed/configs/benchmark_10m_1node.ini @@ -0,0 +1,62 @@ +; 10m: 9M base + 1M insert (insert is ~10% of base, "growing-index" workload). +; 10× larger base index than insert_dominant, 10× smaller than 100m. +; Useful for validating scaling between 1M and 100M without paying the +; multi-hour build cost of 100m. Layers=2, L2 distance, SIFT1B dataset +; (truncated to 10M of the 1B available). +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=/mnt/nvme/proidx_10m_1node/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=9000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=true +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=bench10m_1node + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=1000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=1000000 +AsyncRpcMaxInflight=512 + +[Distributed] +Enabled=true +DispatcherAddr=10.11.0.7:30001 +WorkerAddrs=10.11.0.7:30011 +StoreAddrs=10.11.0.7:20171 +PDAddrs=10.11.0.7:23791 diff --git a/evaluation/distributed/configs/benchmark_10m_2node.ini b/evaluation/distributed/configs/benchmark_10m_2node.ini new file mode 100644 index 000000000..4ed317ac3 --- /dev/null +++ b/evaluation/distributed/configs/benchmark_10m_2node.ini @@ -0,0 +1,62 @@ +; 10m: 9M base + 1M insert (insert is ~10% of base, "growing-index" workload). +; 10× larger base index than insert_dominant, 10× smaller than 100m. +; Useful for validating scaling between 1M and 100M without paying the +; multi-hour build cost of 100m. Layers=2, L2 distance, SIFT1B dataset +; (truncated to 10M of the 1B available). +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=/mnt/nvme/proidx_10m_2node/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=9000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=false +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=bench10m_2node + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=1000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=1000000 +AsyncRpcMaxInflight=512 + +[Distributed] +Enabled=true +DispatcherAddr=10.11.0.7:30001 +WorkerAddrs=10.11.0.7:30011,10.11.0.10:30002 +StoreAddrs=10.11.0.7:20171,10.11.0.10:20171 +PDAddrs=10.11.0.7:23791,10.11.0.10:23791 diff --git a/evaluation/distributed/configs/benchmark_10m_template.ini b/evaluation/distributed/configs/benchmark_10m_template.ini new file mode 100644 index 000000000..f40203559 --- /dev/null +++ b/evaluation/distributed/configs/benchmark_10m_template.ini @@ -0,0 +1,62 @@ +; 10m: 9M base + 1M insert (insert is ~10% of base, "growing-index" workload). +; 10× larger base index than insert_dominant, 10× smaller than 100m. +; Useful for validating scaling between 1M and 100M without paying the +; multi-hour build cost of 100m. Layers=2, L2 distance, SIFT1B dataset +; (truncated to 10M of the 1B available). +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=PLACEHOLDER +ValueType=UInt8 +Dimension=128 +BaseVectorCount=9000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=true +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=PLACEHOLDER + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=1000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=1000000 +AsyncRpcMaxInflight=512 + +[Distributed] +Enabled=true +DispatcherAddr=PLACEHOLDER +WorkerAddrs=PLACEHOLDER +StoreAddrs=PLACEHOLDER +PDAddrs=PLACEHOLDER diff --git a/evaluation/distributed/configs/benchmark_insert_dominant_1node.ini b/evaluation/distributed/configs/benchmark_insert_dominant_1node.ini new file mode 100644 index 000000000..30fe77bbe --- /dev/null +++ b/evaluation/distributed/configs/benchmark_insert_dominant_1node.ini @@ -0,0 +1,58 @@ +; insert_dominant: 1M base + 1M insert with concurrent search-during-insert. +; Layers=2, L2 distance, SIFT1B dataset (truncated to 1M). +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=/mnt/nvme/proidx_insert_dominant_1node/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=1000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=true +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=benchinsert_dominant_1node + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=1000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=100000 + +[Distributed] +Enabled=true +DispatcherAddr=10.11.0.7:30001 +WorkerAddrs=10.11.0.7:30011 +StoreAddrs=10.11.0.7:20171 +PDAddrs=10.11.0.7:23791 diff --git a/evaluation/distributed/configs/benchmark_insert_dominant_2node.ini b/evaluation/distributed/configs/benchmark_insert_dominant_2node.ini new file mode 100644 index 000000000..d45870b50 --- /dev/null +++ b/evaluation/distributed/configs/benchmark_insert_dominant_2node.ini @@ -0,0 +1,58 @@ +; insert_dominant: 1M base + 1M insert with concurrent search-during-insert. +; Layers=2, L2 distance, SIFT1B dataset (truncated to 1M). +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=/mnt/nvme/proidx_insert_dominant_2node/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=1000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=false +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=benchinsert_dominant_2node + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=1000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=100000 + +[Distributed] +Enabled=true +DispatcherAddr=10.11.0.7:30001 +WorkerAddrs=10.11.0.7:30011,10.11.0.10:30002 +StoreAddrs=10.11.0.7:20171,10.11.0.10:20171 +PDAddrs=10.11.0.7:23791,10.11.0.10:23791 diff --git a/evaluation/distributed/configs/benchmark_insert_dominant_3node.ini b/evaluation/distributed/configs/benchmark_insert_dominant_3node.ini new file mode 100644 index 000000000..a8050732d --- /dev/null +++ b/evaluation/distributed/configs/benchmark_insert_dominant_3node.ini @@ -0,0 +1,59 @@ +; insert_dominant: 1M base + 10M insert (10× scale-up) with concurrent search-during-insert. +; Tests how the index handles insertion-dominated workloads where insertion volume +; is much larger than the initial baseline. Layers=2, L2 distance, SIFT1B dataset. +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/data/sift1b/base.1B.u8bin +QueryPath=/mnt/data/sift1b/query.public.10K.u8bin +TruthPath=truth +IndexPath=/mnt/md0/proidx_insert_dominant_3node/spann_index +ValueType=UInt8 +Dimension=128 +BaseVectorCount=1000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=false +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=benchinsert_dominant_3node + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=1000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=100000 + +[Distributed] +Enabled=true +DispatcherAddr=172.27.0.4:30001 +WorkerAddrs=172.27.0.4:30011,172.27.0.5:30002,172.27.0.6:30003 +StoreAddrs=172.27.0.4:20171,172.27.0.5:20171,172.27.0.6:20171 +PDAddrs=172.27.0.4:23791,172.27.0.5:23791,172.27.0.6:23791 diff --git a/evaluation/distributed/configs/benchmark_insert_dominant_template.ini b/evaluation/distributed/configs/benchmark_insert_dominant_template.ini new file mode 100644 index 000000000..f8085c03b --- /dev/null +++ b/evaluation/distributed/configs/benchmark_insert_dominant_template.ini @@ -0,0 +1,58 @@ +; insert_dominant: 1M base + 1M insert with concurrent search-during-insert. +; Layers=2, L2 distance, SIFT1B dataset (truncated to 1M). +; +; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from +; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). +[Benchmark] +WorkerTimeout=14400 +VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin +QueryPath=/mnt/nvme/sift1b/query.10K.u8bin +TruthPath=truth +IndexPath=PLACEHOLDER +ValueType=UInt8 +Dimension=128 +BaseVectorCount=1000000 +InsertVectorCount=1000000 +DeleteVectorCount=0 +BatchNum=1 +TopK=5 +NumSearchThreads=4 +NumInsertThreads=4 +AppendThreadNum=16 +NumSearchDuringInsertThreads=1 +NumQueries=200 +DistMethod=L2 +Rebuild=true +BuildOnly=false +Resume=-1 +Layers=2 + +Storage=TIKVIO +TiKVPDAddresses=PLACEHOLDER +TiKVKeyPrefix=PLACEHOLDER + +[SelectHead] +ParallelBKTBuild=true + +[BuildHead] +ParallelBKTBuild=true + +[BuildSSDIndex] +LatencyLimit=100 +MaxCheck=8192 +SearchInternalResultNum=64 +UseMultiChunkPosting=false +PostingPageLimit=8 +PostingCountCacheCapacity=1000000 +SearchCheckVersionMapOnlyLayer0=true +DistributedVersionMap=true +ReassignK=64 +AsyncMergeInSearch=true +VersionCacheMaxChunks=100000 + +[Distributed] +Enabled=true +DispatcherAddr=PLACEHOLDER +WorkerAddrs=PLACEHOLDER +StoreAddrs=PLACEHOLDER +PDAddrs=PLACEHOLDER diff --git a/evaluation/distributed/configs/cluster_2node.conf b/evaluation/distributed/configs/cluster_2node.conf new file mode 100644 index 000000000..f94500487 --- /dev/null +++ b/evaluation/distributed/configs/cluster_2node.conf @@ -0,0 +1,31 @@ +# 2-node cluster: driver/worker0 on dev-000003 (10.11.0.7), +# worker1 on dev-000006 (10.11.0.10). +# On 000006, /mnt/nvme is symlinked to /mnt_ssd/data7/sptag-bench (data lives on data7 NVMe). +# +# Cluster mode: SHARED TiKV raft cluster. Both PDs form one raft group; both +# TiKVs share the same cluster (max-replicas=1, so each region lives on +# exactly one store and PD routes reads to it). Compute nodes are stateless +# TiKV clients — no cross-compute fetch RPCs during RNGSelection. +[cluster] +ssh_user=superbench +ssh_key=/home/superbench/.ssh/id_rsa +sptag_dir=/home/superbench/zhangt/SPTAG +data_dir=/mnt/nvme +tikv_version=v8.5.1 +pd_version=v8.5.1 +# Image refs (optional). Defaults: +# tikv_image=sptag-tikv (with tag :${tikv_version}) +# pd_image=sptag-pd (with tag :${pd_version}) +# helper_image=mcr.microsoft.com/mirror/docker/library/ubuntu:22.04 +# Override here to use different registries / replace with pingcap/* etc. + +[nodes] +# host router_port +# node 0 (driver) router_port must differ from dispatcher port (hardcoded 30001). +10.11.0.7 30011 +10.11.0.10 30002 + +[tikv] +# host pd_client_port pd_peer_port tikv_port +10.11.0.7 23791 23801 20171 +10.11.0.10 23791 23801 20171 diff --git a/evaluation/distributed/configs/cluster_3node.conf b/evaluation/distributed/configs/cluster_3node.conf new file mode 100644 index 000000000..ff2ba8af4 --- /dev/null +++ b/evaluation/distributed/configs/cluster_3node.conf @@ -0,0 +1,34 @@ +# 3-node cluster: driver/worker0 on 172.27.0.4, +# worker1 on 172.27.0.5 (20.92.202.166), +# worker2 on 172.27.0.6 (20.5.138.158). +# Data lives on /mnt/md0 (NVMe RAID0, ~11T per node). +# +# Cluster mode: SHARED TiKV raft cluster. All PDs form one raft group; all +# TiKVs share the same cluster (max-replicas=1, so each region lives on +# exactly one store and PD routes reads to it). Compute nodes are stateless +# TiKV clients — no cross-compute fetch RPCs during RNGSelection. +[cluster] +ssh_user=azureuser +ssh_key=/home/azureuser/.ssh/id_rsa +sptag_dir=/home/azureuser/zhangt/SPTAG +data_dir=/mnt/md0 +tikv_version=v8.5.1 +pd_version=v8.5.1 +# Image refs (optional). Defaults: +# tikv_image=sptag-tikv (with tag :${tikv_version}) +# pd_image=sptag-pd (with tag :${pd_version}) +# helper_image=mcr.microsoft.com/mirror/docker/library/ubuntu:22.04 +# Override here to use different registries / replace with pingcap/* etc. + +[nodes] +# host router_port +# node 0 (driver) router_port must differ from dispatcher port (hardcoded 30001). +172.27.0.4 30011 +172.27.0.5 30002 +172.27.0.6 30003 + +[tikv] +# host pd_client_port pd_peer_port tikv_port +172.27.0.4 23791 23801 20171 +172.27.0.5 23791 23801 20171 +172.27.0.6 23791 23801 20171 diff --git a/evaluation/distributed/configs/tikv.toml b/evaluation/distributed/configs/tikv.toml new file mode 100755 index 000000000..4ba5282c0 --- /dev/null +++ b/evaluation/distributed/configs/tikv.toml @@ -0,0 +1,74 @@ +memory-usage-limit = "80GB" + +[server] +# v41: 16 → 32 to handle higher concurrent gRPC streams. 96-core host has +# plenty of headroom; previous setting was a default-y stab in the dark. +grpc-concurrency = 32 +grpc-memory-pool-quota = "16GB" + +[raftstore] +region-max-size = "512MB" +region-split-size = "384MB" +region-max-keys = 5120000 +region-split-keys = 3840000 +# v41: 4 → 32. apply-pool is the path raft-log → RocksDB writes go through. +# At 32 concurrent RMW ops per store (4 local insert + 16 receiver sub-workers +# + 4 search + 4 search-during-insert + misc), a 4-thread apply pool meant +# ~8× queue depth, which is the primary write-amp source we observed +# (TiKV at 7/96 cores while ops are still queueing). +apply-pool-size = 32 +# v41: 4 → 16. store-pool routes raft messages between peers and to apply. +store-pool-size = 16 +# v41: batch up raft entries per fsync. If we're disk-fsync bound (likely), +# this directly amortizes the sync cost. +raft-write-batch-size = "1MB" + +[storage] +reserve-space = "1GB" +# v41: 4 (default) → 16. KV scheduler is the front-end before raftstore. +scheduler-worker-pool-size = 16 + +[storage.block-cache] +capacity = "60GB" + +# v41: new section. Read pool default = 0.8×CPU = 76 on 96-core host, which +# would let reads steal CPU from writes. Cap at 32 to leave room for write +# path. Min 8 ensures reads stay responsive under light load. +[readpool.unified] +max-thread-count = 32 +min-thread-count = 8 + +[rocksdb] +max-background-jobs = 32 +max-sub-compactions = 8 +# v41: 8 dedicated flush threads (subset of max-background-jobs). Reduces +# the chance that compaction monopolizes background-jobs and starves flushes. +max-background-flushes = 8 +rate-bytes-per-sec = "0" + +[rocksdb.defaultcf] +# v41: 512MB → 1GB. Bigger memtable means fewer flushes (and thus fewer L0 +# files), reducing the chance of slowdown/stop write triggers under burst. +write-buffer-size = "1GB" +# v41: 5 → 8. More memtables = more headroom before flush back-pressure. +max-write-buffer-number = 8 +min-write-buffer-number-to-merge = 2 +level0-file-num-compaction-trigger = 12 +# v41: 28 → 40, 40 → 60. Loosen the L0 stall thresholds so bursts have more +# slack. With 10K-item chunks (v39+) we generate more small writes than v38 +# did, so we hit slowdown more often. +level0-slowdown-writes-trigger = 40 +level0-stop-writes-trigger = 60 +max-bytes-for-level-base = "2GB" +compression-per-level = ["no", "no", "no", "lz4", "lz4", "zstd", "zstd"] +target-file-size-base = "128MB" + +[rocksdb.writecf] +write-buffer-size = "128MB" +max-write-buffer-number = 5 + +[coprocessor] +region-max-size = "512MB" +region-split-size = "384MB" +region-max-keys = 5120000 +region-split-keys = 3840000 diff --git a/evaluation/distributed/run_distributed.sh b/evaluation/distributed/run_distributed.sh new file mode 100755 index 000000000..c383a7eed --- /dev/null +++ b/evaluation/distributed/run_distributed.sh @@ -0,0 +1,1364 @@ +#!/bin/bash +# Multi-machine distributed benchmark orchestrator for SPTAG. +# +# Usage: +# ./run_distributed.sh deploy Deploy binary + data to all nodes +# ./run_distributed.sh setup-bins Download tikv-server / pd-server to every node +# ./run_distributed.sh start-tikv [node_count] Start independent TiKV/PD instances +# ./run_distributed.sh stop-tikv [node_count] Stop TiKV/PD instances +# ./run_distributed.sh run Run benchmark +# ./run_distributed.sh bench [scale...] Run 1-node + N-node for each scale +# ./run_distributed.sh cleanup Remove deployed files from remote nodes +# +# Environment variables: +# NOCACHE=1 Disable all caches (TiKV block cache, OS page cache, VersionCache) +# BUILD_WITH_CACHE=1 (only with NOCACHE=1) Use cached TiKV+VersionCache during the +# build phase, then restart TiKV with nocache config and drop all +# OS caches before the search/insert phase. Useful for large scales +# (e.g. 100M) where building under nocache is impractical. +# SKIP_TIKV_SWAP=1 (only with BUILD_WITH_CACHE=1) Skip the TiKV container restart. +# Drop OS caches and rely on VersionCache=0 INI overrides for "nocache" +# semantics. Avoids docker rm -f corruption that has destroyed recall +# at 100M scale; TiKV block cache stays warm but contains mostly recent +# build writes (random search reads largely miss it anyway). +# SKIP_SAVE_LOAD=1 (only with NOCACHE=1) Bypass the post-build SaveIndex / per-batch +# LoadIndex / Clone / SaveIndex cycles. For 1-node, build+search+insert +# run in a single SPTAGTest process, dropping OS pagecache after build. +# For 2-node, the build phase skips the broken final SaveIndex (relies +# on the index files written during BuildLargeIndex). Required at 100M +# scale where SaveIndex's "wait for all background jobs to finish" loop +# never terminates and risks a gRPC SEGFAULT after several hours. +# VersionCache cannot be reset mid-process so it stays warm from build. +# SKIP_HEAD_BUILD=1 Reuse existing HeadIndex if present (RebuildSSDOnly). Falls back to +# full build if HeadIndex is missing. +# +# Prerequisites: +# - Passwordless SSH from driver to all nodes (configure ssh_key in cluster.conf) +# - Docker installed on all nodes (for TiKV) +# - cluster.conf configured (see cluster.conf.example) +# +# The driver (first node in [nodes]) orchestrates everything. +# Compute nodes share a single TiKV raft cluster: all PDs join one raft group, +# all TiKVs point to all PDs, max-replicas=1 (no replication, each region on +# exactly one store). With 2 nodes this gives 2 PDs + 2 TiKV stores in one +# cluster; any compute can read any posting via PD-routed TiKV calls, so the +# distributed routing layer no longer needs to forward reads between computes. + +set -o pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +LOGDIR="$(cd "$SCRIPT_DIR/../.." && pwd)/benchmark_logs" +mkdir -p "$LOGDIR" + +# ─── Config Parsing ─── + +declare -a NODE_HOSTS NODE_ROUTER_PORTS +declare -a TIKV_HOSTS TIKV_PD_CLIENT_PORTS TIKV_PD_PEER_PORTS TIKV_PORTS +declare SSH_USER SPTAG_DIR DATA_DIR TIKV_VERSION PD_VERSION SSH_KEY +declare TIKV_IMAGE PD_IMAGE HELPER_IMAGE BIN_DIR MIRROR +TOTAL_NODES=0 + +parse_config() { + local CONF="$1" + if [ ! -f "$CONF" ]; then + echo "ERROR: Config file not found: $CONF" + exit 1 + fi + + local SECTION="" + + while IFS= read -r line || [ -n "$line" ]; do + # Strip comments and whitespace + line="${line%%#*}" + line="$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" + [ -z "$line" ] && continue + + # Section header + if [[ "$line" =~ ^\[(.+)\]$ ]]; then + SECTION="${BASH_REMATCH[1]}" + continue + fi + + case "$SECTION" in + cluster) + local key="${line%%=*}" + local val="${line#*=}" + case "$key" in + ssh_user) SSH_USER="$val" ;; + sptag_dir) SPTAG_DIR="$val" ;; + data_dir) DATA_DIR="$val" ;; + tikv_version) TIKV_VERSION="$val" ;; + pd_version) PD_VERSION="$val" ;; + tikv_image) TIKV_IMAGE="$val" ;; + pd_image) PD_IMAGE="$val" ;; + helper_image) HELPER_IMAGE="$val" ;; + bin_dir) BIN_DIR="$val" ;; + mirror) MIRROR="$val" ;; + ssh_key) SSH_KEY="$val" ;; + esac + ;; + nodes) + read -r host rport <<< "$line" + NODE_HOSTS+=("$host") + NODE_ROUTER_PORTS+=("$rport") + ;; + tikv) + read -r host pd_client pd_peer tikv_port <<< "$line" + TIKV_HOSTS+=("$host") + TIKV_PD_CLIENT_PORTS+=("$pd_client") + TIKV_PD_PEER_PORTS+=("$pd_peer") + TIKV_PORTS+=("$tikv_port") + ;; + esac + done < "$CONF" + + # Defaults + SSH_USER="${SSH_USER:-$(whoami)}" + TIKV_VERSION="${TIKV_VERSION:-v8.5.1}" + PD_VERSION="${PD_VERSION:-v8.5.1}" + # Single image used for ALL containers (PD, TiKV, helper). Stock MCR + # ubuntu:22.04 — never modified, never layered, so security scanners see + # only the MCR base image. TiKV / PD binaries are downloaded to the host + # at $BIN_DIR by `setup-bins` and bind-mounted into the container. + HELPER_IMAGE="${HELPER_IMAGE:-mcr.microsoft.com/mirror/docker/library/ubuntu:22.04}" + TIKV_IMAGE="${TIKV_IMAGE:-${HELPER_IMAGE}}" + PD_IMAGE="${PD_IMAGE:-${HELPER_IMAGE}}" + # Host path on every node where tikv-server / pd-server live. Populated + # by `setup-bins`. Mounted read-only into containers as /sptag-bin. + BIN_DIR="${BIN_DIR:-${SPTAG_DIR}/evaluation/distributed/bin}" + MIRROR="${MIRROR:-https://tiup-mirrors.pingcap.com}" + + # Expand ~ in ssh_key path + if [ -n "$SSH_KEY" ]; then + SSH_KEY="${SSH_KEY/#\~/$HOME}" + fi + + TOTAL_NODES=${#NODE_HOSTS[@]} + + if [ "$TOTAL_NODES" -lt 1 ]; then + echo "ERROR: No compute nodes defined in [nodes]" + exit 1 + fi + if [ ${#TIKV_HOSTS[@]} -lt 1 ]; then + echo "ERROR: No TiKV instances defined in [tikv]" + exit 1 + fi + + echo "Cluster config loaded:" + echo " Compute nodes: $TOTAL_NODES (driver: ${NODE_HOSTS[0]})" + echo " TiKV instances: ${#TIKV_HOSTS[@]}" + echo " SSH user: $SSH_USER" + echo " SSH key: ${SSH_KEY:-(none)}" + echo " SPTAG dir: $SPTAG_DIR" + echo " Data dir: $DATA_DIR" +} + +# ─── SSH Helpers ─── + +# Build SSH options string (key + host checking) +_ssh_opts() { + local opts="-o StrictHostKeyChecking=no -o ConnectTimeout=10" + if [ -n "$SSH_KEY" ]; then + opts+=" -i $SSH_KEY" + fi + echo "$opts" +} + +# Run command on remote host (or locally if it's the driver) +remote_exec() { + local host="$1"; shift + if [ "$host" = "${NODE_HOSTS[0]}" ] || [ "$host" = "localhost" ] || [ "$host" = "127.0.0.1" ]; then + eval "$@" + else + ssh $(_ssh_opts) "$SSH_USER@$host" "$@" + fi +} + +# rsync files to remote host +remote_sync() { + local host="$1" + local src="$2" + local dst="$3" + if [ "$host" = "${NODE_HOSTS[0]}" ] || [ "$host" = "localhost" ]; then + # Local copy — skip if same path + if [ "$(realpath "$src")" != "$(realpath "$dst")" ]; then + rsync -az --progress "$src" "$dst" + fi + else + rsync -az --progress -e "ssh $(_ssh_opts)" "$src" "$SSH_USER@$host:$dst" + fi +} + +# ─── Deploy ─── + +cmd_deploy() { + echo "" + echo "=== Deploying SPTAG to ${#NODE_HOSTS[@]} nodes ===" + echo "" + + # Validate SSH connectivity + for host in "${NODE_HOSTS[@]}"; do + if [ "$host" = "${NODE_HOSTS[0]}" ]; then continue; fi + echo -n " Checking SSH to $host... " + if remote_exec "$host" "echo ok" >/dev/null 2>&1; then + echo "OK" + else + echo "FAILED" + echo "ERROR: Cannot SSH to $SSH_USER@$host" + exit 1 + fi + done + + # Deploy binary to all remote nodes + echo "" + echo "Deploying binary..." + local BINARY="$SPTAG_DIR/Release/SPTAGTest" + if [ ! -f "$BINARY" ]; then + echo "ERROR: Binary not found: $BINARY (run cmake build first)" + exit 1 + fi + + for host in "${NODE_HOSTS[@]}"; do + if [ "$host" = "${NODE_HOSTS[0]}" ]; then continue; fi + echo " → $host:$SPTAG_DIR/Release/" + remote_exec "$host" "mkdir -p $SPTAG_DIR/Release" + remote_sync "$host" "$BINARY" "$SPTAG_DIR/Release/SPTAGTest" + # Also deploy any shared libraries + if ls "$SPTAG_DIR/Release/"*.so 2>/dev/null; then + remote_sync "$host" "$SPTAG_DIR/Release/*.so" "$SPTAG_DIR/Release/" + fi + # Deploy bundled runtime libs (boost 1.73 / abseil / tbb / libstdc++) + # used by SPTAGTest. Not committed; produced locally on the driver. + if [ -d "$SPTAG_DIR/Release/runtime_libs" ]; then + remote_exec "$host" "mkdir -p $SPTAG_DIR/Release/runtime_libs" + rsync -az -e "ssh $(_ssh_opts)" \ + "$SPTAG_DIR/Release/runtime_libs/" \ + "$SSH_USER@$host:$SPTAG_DIR/Release/runtime_libs/" + fi + done + + # Deploy data files (perftest_* vectors, queries) + echo "" + echo "Deploying data files..." + for host in "${NODE_HOSTS[@]}"; do + if [ "$host" = "${NODE_HOSTS[0]}" ]; then continue; fi + echo " → $host:$SPTAG_DIR/ (perftest_* files)" + remote_exec "$host" "mkdir -p $SPTAG_DIR" + rsync -az --progress \ + --include='perftest_*' --exclude='*' \ + -e "ssh $(_ssh_opts)" \ + "$SPTAG_DIR/" "$SSH_USER@$host:$SPTAG_DIR/" + done + + echo "" + echo "Deploy complete." +} + +# ─── TiKV/PD Binary Setup ─── + +setup_bins_one_host() { + # Ensure tikv-server / pd-server are present at $BIN_DIR on $1. + # Downloads from $MIRROR if missing or version mismatch. Idempotent. + local host="$1" + local cmd + # shellcheck disable=SC2016 + cmd='set -e + mkdir -p "'"$BIN_DIR"'" + cd "'"$BIN_DIR"'" + need_tikv=1 + if [ -x tikv-server ] && ./tikv-server --version 2>/dev/null | grep -q "Release Version:[[:space:]]*'"${TIKV_VERSION#v}"'"; then + need_tikv=0 + fi + if [ "$need_tikv" = "1" ]; then + echo " Downloading tikv-'"${TIKV_VERSION}"'..." + curl -fsSL "'"${MIRROR}"'/tikv-'"${TIKV_VERSION}"'-linux-amd64.tar.gz" | tar -xz + chmod +x tikv-server + else + echo " tikv-'"${TIKV_VERSION}"' already present" + fi + need_pd=1 + if [ -x pd-server ] && ./pd-server --version 2>/dev/null | grep -q "Release Version:[[:space:]]*'"${PD_VERSION}"'"; then + need_pd=0 + fi + if [ "$need_pd" = "1" ]; then + echo " Downloading pd-'"${PD_VERSION}"'..." + curl -fsSL "'"${MIRROR}"'/pd-'"${PD_VERSION}"'-linux-amd64.tar.gz" | tar -xz + chmod +x pd-server pd-ctl pd-recover 2>/dev/null || true + else + echo " pd-'"${PD_VERSION}"' already present" + fi' + + if [ "$host" = "${NODE_HOSTS[0]}" ] || [ "$host" = "localhost" ] || [ "$host" = "127.0.0.1" ]; then + bash -c "$cmd" + else + remote_exec "$host" "$cmd" + fi +} + +cmd_setup_bins() { + # Download tikv-server + pd-server to ${BIN_DIR} on every distinct host + # used by the cluster (compute nodes ∪ tikv nodes). Idempotent. + echo "" + echo "=== Setting up TiKV/PD binaries ===" + echo " BIN_DIR : $BIN_DIR" + echo " TIKV : $TIKV_VERSION" + echo " PD : $PD_VERSION" + echo " MIRROR : $MIRROR" + + declare -A seen + local -a hosts=() + local h + for h in "${NODE_HOSTS[@]}" "${TIKV_HOSTS[@]}"; do + if [ -z "${seen[$h]:-}" ]; then + seen[$h]=1 + hosts+=("$h") + fi + done + + for h in "${hosts[@]}"; do + echo "" + echo "→ $h" + setup_bins_one_host "$h" + done + + echo "" + echo "Binary setup complete." +} + +# ─── TiKV Management (Independent Mode) ─── + + +tikv_start() { + # Start the first PD+TiKV pairs. + # + # node_count == 1: standalone PD + TiKV (1-node benchmarks). + # node_count >= 2: SHARED raft cluster — all PDs join one raft group, + # all TiKVs point to all PDs. max-replicas=1 so each + # region lives on exactly one store; PD routes reads + # to whichever store has the region. + local node_count="${1:-${#TIKV_HOSTS[@]}}" + echo "" + if [ "$node_count" -le 1 ]; then + echo "=== Starting 1 standalone TiKV instance ===" + else + echo "=== Starting $node_count-node SHARED TiKV raft cluster ===" + fi + + # Ensure binaries are present on every host that will run a container. + # Cheap if already there (version-grep, no download). + local i_host + for (( i_host=0; i_host/dev/null | tr -d '[:space:]') + fi + if [ "$present" != "yes" ]; then + echo " → $h: binaries missing, running setup-bins" + setup_bins_one_host "$h" + fi + done + + # Build the initial-cluster string used by every PD. + # For 1-node it's a single-member raft; for N>=2 every PD lists all members. + local initial_cluster="" + for (( i=0; i= 2 they form a raft group. + echo "Starting PD instances (initial-cluster=${initial_cluster})..." + for (( i=0; i/dev/null; \ + docker run -d --name sptag-pd-$i --net host \ + -v $DATA_DIR/tikv-data/pd-$i:/data \ + -v ${BIN_DIR}:/sptag-bin:ro \ + --entrypoint /sptag-bin/pd-server \ + ${PD_IMAGE} \ + --name=${pd_name} \ + --data-dir=/data \ + --client-urls=http://0.0.0.0:${client_port} \ + --advertise-client-urls=http://${host}:${client_port} \ + --peer-urls=http://0.0.0.0:${peer_port} \ + --advertise-peer-urls=http://${host}:${peer_port} \ + --initial-cluster=${initial_cluster}" + done + + echo "Waiting for PD raft to form..." + sleep 5 + + # Wait until every PD reports the expected member count (raft quorum up). + for (( i=0; i/dev/null \ + | python3 -c "import sys,json; d=json.load(sys.stdin); print(len(d.get('members',[])))" 2>/dev/null || echo 0) + if [ "$members" -ge "$node_count" ]; then + echo " PD $i ($host:$pd_port) healthy (members=${members})" + break + fi + if [ "$attempt" -eq 60 ]; then + echo " ERROR: PD $i ($host:$pd_port) only sees ${members}/${node_count} members after 60s" + return 1 + fi + sleep 1 + done + done + + # NOTE: max-replicas is configured AFTER TiKV starts (see below). Setting + # placement rules requires cluster bootstrap, which only happens once a + # TiKV store joins. Before bootstrap, /pd/api/v1/config/rule returns 500 + # ErrNotBootstrapped. We rely on the fact that no data is written until + # SPTAGTest connects (which happens after this function returns), so the + # brief window where bootstrap uses default max-replicas=3 is harmless. + + # Start TiKV instances pointing at the shared PD endpoints. + echo "Starting TiKV instances (pd-endpoints=${pd_endpoints})..." + for (( i=0; i/dev/null; \ + docker run -d --name sptag-tikv-$i --net host \ + --ulimit nofile=1048576:1048576 \ + -v $DATA_DIR/tikv-data/tikv-$i:/data \ + -v $DATA_DIR/tikv-data/conf:/conf \ + -v ${BIN_DIR}:/sptag-bin:ro \ + --entrypoint /sptag-bin/tikv-server \ + ${TIKV_IMAGE} \ + --config=/conf/tikv.toml \ + --addr=0.0.0.0:${tikv_port} \ + --advertise-addr=${host}:${tikv_port} \ + --data-dir=/data \ + --pd-endpoints=${pd_endpoints}" + done + + echo "Waiting for TiKV stores to register..." + sleep 5 + + # All stores show up in PD's store list (any PD works — they share state). + local pd_host="${TIKV_HOSTS[0]}" + local pd_port_first="${TIKV_PD_CLIENT_PORTS[0]}" + for attempt in $(seq 1 60); do + local store_count + store_count=$(curl -sf "http://${pd_host}:${pd_port_first}/pd/api/v1/stores" 2>/dev/null \ + | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('count',0))" 2>/dev/null || echo 0) + if [ "$store_count" -ge "$node_count" ]; then + echo " All ${store_count} TiKV stores registered" + break + fi + if [ "$attempt" -eq 60 ]; then + echo " WARNING: only ${store_count}/${node_count} TiKV stores registered after 60s" + fi + sleep 1 + done + + # Set max-replicas=1 on the shared cluster, NOW that cluster is bootstrapped. + # + # PD v6+ defaults to enable-placement-rules=true. The authoritative source + # for replica count is then the default placement rule, NOT the legacy + # max-replicas config. /config POST auto-syncs to the rule but is racy; + # we explicitly POST the rule too. Both endpoints require bootstrap. + # Bug seen v45: skipping this caused 30%+ of a 1-node run to execute with + # max-replicas=3 → PD endlessly tried to schedule replicas onto 1 store + # → constant region state changes → gRPC Deadline / region_error storm. + echo "Setting max-replicas=1 (default placement rule)..." + local target_replicas=1 + local mr_ok=0 + for attempt in $(seq 1 30); do + curl -sf "http://${pd_host}:${pd_port_first}/pd/api/v1/config" \ + -X POST -d "{\"max-replicas\": ${target_replicas}}" >/dev/null 2>&1 || true + curl -sf "http://${pd_host}:${pd_port_first}/pd/api/v1/config/rule" \ + -X POST -d "{\"group_id\":\"pd\",\"id\":\"default\",\"start_key\":\"\",\"end_key\":\"\",\"role\":\"voter\",\"count\":${target_replicas}}" \ + >/dev/null 2>&1 || true + sleep 1 + local got_cfg + got_cfg=$(curl -sf "http://${pd_host}:${pd_port_first}/pd/api/v1/config/replicate" 2>/dev/null \ + | python3 -c 'import sys,json;print(json.load(sys.stdin).get("max-replicas"))' 2>/dev/null) + local got_rule + got_rule=$(curl -sf "http://${pd_host}:${pd_port_first}/pd/api/v1/config/rule/pd/default" 2>/dev/null \ + | python3 -c 'import sys,json;print(json.load(sys.stdin).get("count"))' 2>/dev/null) + if [ "$got_cfg" = "$target_replicas" ] && [ "$got_rule" = "$target_replicas" ]; then + echo " max-replicas=${target_replicas} set (attempt $attempt, config & rule verified)" + mr_ok=1 + break + fi + sleep 1 + done + if [ "$mr_ok" != "1" ]; then + echo " ERROR: Failed to set max-replicas=${target_replicas} after 30 attempts. Aborting." >&2 + return 1 + fi + + echo "TiKV cluster started ($node_count node(s))." +} + +tikv_stop() { + # Stop the first TiKV+PD instances. + local node_count="${1:-${#TIKV_HOSTS[@]}}" + echo "" + echo "=== Stopping $node_count TiKV instances ===" + + for (( i=0; i/dev/null || true" + done + + echo "TiKV instances stopped." +} + +tikv_switch_to_nocache() { + # Restart TiKV containers (NOT PD) with the nocache config, so that the search + # and insert phases use cold block cache. Data on disk is preserved because we + # reuse the same data-dir; PD keeps the cluster metadata. + local node_count="${1:-${#TIKV_HOSTS[@]}}" + if [[ ! -f "$SCRIPT_DIR/configs/tikv_nocache.toml" ]]; then + echo " ERROR: configs/tikv_nocache.toml not found; cannot switch to nocache" + return 1 + fi + echo "" + echo "=== Restarting $node_count TiKV instances with tikv_nocache.toml ===" + + # Reconstruct the shared pd-endpoints list (same as tikv_start). + local pd_endpoints="" + for (( i=0; i/dev/null; \ + docker rm -f sptag-tikv-$i 2>/dev/null; \ + docker run -d --name sptag-tikv-$i --net host \ + --ulimit nofile=1048576:1048576 \ + -v $DATA_DIR/tikv-data/tikv-$i:/data \ + -v $DATA_DIR/tikv-data/conf:/conf \ + -v ${BIN_DIR}:/sptag-bin:ro \ + --entrypoint /sptag-bin/tikv-server \ + ${TIKV_IMAGE} \ + --config=/conf/tikv.toml \ + --addr=0.0.0.0:${tikv_port} \ + --advertise-addr=${host}:${tikv_port} \ + --data-dir=/data \ + --pd-endpoints=${pd_endpoints}" + done + + echo "Waiting for TiKV stores to re-register..." + sleep 5 + local pd_host_first="${TIKV_HOSTS[0]}" + local pd_port_first="${TIKV_PD_CLIENT_PORTS[0]}" + for attempt in $(seq 1 60); do + local store_count + store_count=$(curl -sf "http://${pd_host_first}:${pd_port_first}/pd/api/v1/stores" 2>/dev/null \ + | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('count',0))" 2>/dev/null || echo 0) + if [ "$store_count" -ge "$node_count" ]; then + echo " All ${store_count} TiKV stores re-registered" + break + fi + if [ "$attempt" -eq 60 ]; then + echo " WARNING: only ${store_count}/${node_count} stores re-registered after 60s" + fi + sleep 1 + done + echo "TiKV switched to nocache mode." +} + +tikv_clean() { + # Clean TiKV data for the first instances. + local node_count="${1:-${#TIKV_HOSTS[@]}}" + echo "" + echo "=== Cleaning TiKV data ($node_count instances) ===" + + for (( i=0; i/dev/null || true" + done +} + +# Legacy wrappers for the main case block +cmd_start_tikv() { tikv_start "${1:-${#TIKV_HOSTS[@]}}"; } +cmd_stop_tikv() { tikv_stop "${1:-${#TIKV_HOSTS[@]}}"; } + +# ─── Cache Management ─── + +drop_all_caches() { + # Drop OS page cache + dentries/inodes on the first nodes. + # This may take 30-60s per node if there are many dirty pages. + local node_count="${1:-1}" + if [[ "${SKIP_DROP_CACHES:-0}" == "1" ]]; then + echo "[SKIP_DROP_CACHES=1] skipping OS page-cache drop on $node_count node(s)" + return 0 + fi + echo "Dropping OS page cache on $node_count node(s) (timeout 10s per node)..." + for (( i=0; i /proc/sys/vm/drop_caches'" && echo "done" || echo "timeout/failed (non-fatal)" + done + echo "Cache drop complete." +} + +# ─── INI Generation ─── + +generate_ini() { + # Generate a benchmark INI from a template, filling in [Distributed] fields. + # Usage: generate_ini [overrides...] + local SCALE="$1" + local NODE_COUNT="$2" + shift 2 + + local IDX_PATH="$DATA_DIR/proidx_${SCALE}_${NODE_COUNT}node/spann_index" + local KEY_PREFIX="bench${SCALE}_${NODE_COUNT}node" + + # Build comma-separated address lists from the first node_count entries + local dispatcher_addr="${NODE_HOSTS[0]}:30001" + local worker_addrs="" store_addrs="" pd_addrs="" + for (( i=0; i&2 + return 1 + fi + + local OUT="$SCRIPT_DIR/configs/benchmark_${SCALE}_${NODE_COUNT}node.ini" + cp "$BASE_INI" "$OUT" + + # Fill in placeholder fields + sed -i "s|^IndexPath=.*|IndexPath=${IDX_PATH}|" "$OUT" + sed -i "s|^TiKVKeyPrefix=.*|TiKVKeyPrefix=${KEY_PREFIX}|" "$OUT" + sed -i "s|^DispatcherAddr=.*|DispatcherAddr=${dispatcher_addr}|" "$OUT" + sed -i "s|^WorkerAddrs=.*|WorkerAddrs=${worker_addrs}|" "$OUT" + sed -i "s|^StoreAddrs=.*|StoreAddrs=${store_addrs}|" "$OUT" + sed -i "s|^PDAddrs=.*|PDAddrs=${pd_addrs}|" "$OUT" + + # Apply extra overrides (key=value pairs) + for override in "$@"; do + local key="${override%%=*}" + local val="${override#*=}" + if grep -q "^${key}=" "$OUT"; then + sed -i "s|^${key}=.*|${key}=${val}|" "$OUT" + else + # Append to [Benchmark] section + sed -i "/^\[Benchmark\]/a ${key}=${val}" "$OUT" + fi + done + + echo "$OUT" +} + +# ─── Worker Management ─── + +WORKER_SSH_PIDS=() + +start_remote_worker() { + # Start a worker on a remote node. Returns immediately; worker runs in background. + local NODE_IDX="$1" + local INI="$2" + local SCALE="$3" + local NODE_COUNT="$4" + local host="${NODE_HOSTS[$NODE_IDX]}" + local LOG="$LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_worker${NODE_IDX}.log" + + # Copy INI + binary to remote + remote_sync "$host" "$INI" "$SPTAG_DIR/worker_n${NODE_IDX}.ini" + + # Start worker via SSH (foreground on remote, background locally). + # Use `ssh -n` to redirect stdin from /dev/null so SSH doesn't try to + # acquire a TTY when the parent script runs under `nohup`. Without -n, + # the SSH client sometimes silently re-points fd1 → /dev/null and fd2 + # → a deleted /tmp file, dropping the worker log. + ssh -n $(_ssh_opts) "$SSH_USER@$host" \ + "cd $SPTAG_DIR && LD_LIBRARY_PATH=$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:\${LD_LIBRARY_PATH:-} \ + WORKER_INDEX=${NODE_IDX} BENCHMARK_CONFIG=worker_n${NODE_IDX}.ini \ + SPFRESH_SHARD_STRIDE=${SPFRESH_SHARD_STRIDE:-0} \ + ./Release/SPTAGTest --run_test=SPFreshTest/BenchmarkFromConfig 2>&1" \ + "$LOG" 2>&1 & + local ssh_pid=$! + WORKER_SSH_PIDS+=($ssh_pid) + echo " Worker n${NODE_IDX} on $host (SSH PID: $ssh_pid, log: $LOG)" +} + +wait_workers_ready() { + local SCALE="$1" + local NODE_COUNT="$2" + local TIMEOUT=120 + + echo "Waiting for ${#WORKER_SSH_PIDS[@]} workers to be ready..." + for attempt in $(seq 1 $TIMEOUT); do + local all_ready=true + for i in $(seq 1 $((NODE_COUNT - 1))); do + local LOG="$LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_worker${i}.log" + if ! grep -q "Worker.*[Rr]eady\|Waiting for dispatch" "$LOG" 2>/dev/null; then + all_ready=false + fi + done + if $all_ready; then + echo " All workers ready (${attempt}s)" + return 0 + fi + # Check if any worker SSH process died + for idx in "${!WORKER_SSH_PIDS[@]}"; do + if ! kill -0 "${WORKER_SSH_PIDS[$idx]}" 2>/dev/null; then + echo " ERROR: Worker SSH PID ${WORKER_SSH_PIDS[$idx]} exited prematurely" + return 1 + fi + done + sleep 1 + done + echo " WARNING: Not all workers ready after ${TIMEOUT}s" + return 1 +} + +stop_remote_workers() { + # Wait for workers to self-exit (driver sends TCP Stop), then force-kill. + local TIMEOUT=${1:-30} + if [ ${#WORKER_SSH_PIDS[@]} -eq 0 ]; then return; fi + + echo "Waiting for ${#WORKER_SSH_PIDS[@]} remote workers to exit (${TIMEOUT}s timeout)..." + for pid in "${WORKER_SSH_PIDS[@]}"; do + local elapsed=0 + while kill -0 "$pid" 2>/dev/null && [ $elapsed -lt $TIMEOUT ]; do + sleep 1 + elapsed=$((elapsed + 1)) + done + if kill -0 "$pid" 2>/dev/null; then + echo " WARNING: SSH PID $pid still alive, force killing" + kill -9 "$pid" 2>/dev/null || true + wait "$pid" 2>/dev/null || true + else + echo " Worker (SSH PID $pid) exited gracefully" + fi + done + WORKER_SSH_PIDS=() +} + +# Watchdog: detect driver death (segfault, OOM, SIGKILL by oom_killer, ...) +# and tear down remote workers so they don't linger forever. +# The C++ heartbeat watchdog inside the worker is the primary defense (bounded +# at HeartbeatTimeoutSec, default 180s). This shell watchdog is a faster +# secondary path: as soon as the driver PID is gone we (a) kill the local SSH +# wrappers and (b) `pkill` the remote SPTAGTest processes. +DRIVER_WATCHDOG_PID="" + +start_driver_watchdog() { + local DRIVER_PID="$1" + local NODE_COUNT="$2" + if [ "$NODE_COUNT" -lt 2 ]; then return; fi + if [ ${#WORKER_SSH_PIDS[@]} -eq 0 ]; then return; fi + + # Snapshot what we need before backgrounding (subshell forks current env). + local _ssh_pids="${WORKER_SSH_PIDS[*]}" + local _hosts=() + for (( i=1; i/dev/null; do + sleep 5 + done + echo "[watchdog] Driver PID $DRIVER_PID is gone; tearing down remote workers" >&2 + for pid in $_ssh_pids; do + kill -TERM "$pid" 2>/dev/null || true + done + for host in $_hosts_str; do + ssh -n $_ssh_opts_str "$_ssh_user@$host" \ + "pkill -TERM -f 'SPTAGTest.*BenchmarkFromConfig' 2>/dev/null; \ + sleep 5; \ + pkill -KILL -f 'SPTAGTest.*BenchmarkFromConfig' 2>/dev/null; true" \ + /dev/null 2>&1 || true + done + for pid in $_ssh_pids; do + kill -0 "$pid" 2>/dev/null && kill -KILL "$pid" 2>/dev/null || true + done + ) & + DRIVER_WATCHDOG_PID=$! + echo " Driver watchdog started (PID: $DRIVER_WATCHDOG_PID, monitoring driver $DRIVER_PID)" +} + +stop_driver_watchdog() { + if [ -n "$DRIVER_WATCHDOG_PID" ] && kill -0 "$DRIVER_WATCHDOG_PID" 2>/dev/null; then + kill -TERM "$DRIVER_WATCHDOG_PID" 2>/dev/null || true + wait "$DRIVER_WATCHDOG_PID" 2>/dev/null || true + fi + DRIVER_WATCHDOG_PID="" +} + +# ─── Benchmark Run ─── + +distribute_head_index() { + # Copy the head index from driver to all worker nodes. + local SCALE="$1" + local NODE_COUNT="$2" + local SRC="$DATA_DIR/proidx_${SCALE}_${NODE_COUNT}node/spann_index" + + echo "Distributing head index to $((NODE_COUNT - 1)) workers..." + for (( i=1; i +resolve_build_mode() { + local SCALE="$1" NODE_COUNT="$2" + local IDX_DIR="$DATA_DIR/proidx_${SCALE}_${NODE_COUNT}node/spann_index" + local HEAD_DIR="$IDX_DIR/HeadIndex" + + BUILD_MODE_OVERRIDES=() + if [[ "${SKIP_HEAD_BUILD:-0}" == "1" ]] && [ -d "$HEAD_DIR" ] && [ -n "$(ls -A "$HEAD_DIR" 2>/dev/null)" ]; then + echo "HeadIndex found at $HEAD_DIR — using RebuildSSDOnly (skip SelectHead+BuildHead)" + BUILD_MODE_OVERRIDES=("RebuildSSDOnly=true") + else + if [[ "${SKIP_HEAD_BUILD:-0}" == "1" ]]; then + echo "SKIP_HEAD_BUILD=1 but HeadIndex not found at $HEAD_DIR — falling back to full build" + fi + BUILD_MODE_OVERRIDES=("Rebuild=true") + fi +} + +cmd_run() { + local SCALE="$1" + local NODE_COUNT="$2" + if [ -z "$SCALE" ] || [ -z "$NODE_COUNT" ]; then + echo "Usage: $0 run " + exit 1 + fi + + local BINARY="$SPTAG_DIR/Release/SPTAGTest" + + echo "" + echo "═══════════════════════════════════════════════════" + echo " ${SCALE}: ${NODE_COUNT}-node benchmark${NOCACHE:+ [NOCACHE]}" + echo " Start: $(date)" + echo "═══════════════════════════════════════════════════" + + if [ "$NODE_COUNT" -eq 1 ]; then + # ─── Single-node flow ─── + echo "" + echo "--- Phase 0: Prepare TiKV (1 instance) ---" + tikv_stop 1 + tikv_clean 1 + if ! tikv_start 1; then + echo "ERROR: tikv_start failed; aborting benchmark." >&2 + return 1 + fi + + # Resolve build mode before cleaning (SKIP_HEAD_BUILD needs existing dir) + resolve_build_mode "$SCALE" "$NODE_COUNT" + + if [[ " ${BUILD_MODE_OVERRIDES[*]} " != *"RebuildSSDOnly=true"* ]]; then + # Full build: clean old index dir + rm -rf "$DATA_DIR/proidx_${SCALE}_1node" + fi + mkdir -p "$DATA_DIR/proidx_${SCALE}_1node" + + if [[ "${NOCACHE:-0}" == "1" ]]; then + # NOCACHE: Split into build + cache-drop + search + local BUILD_VERSIONCACHE_OVERRIDES=("VersionCacheTTLMs=0" "VersionCacheMaxChunks=0") + if [[ "${BUILD_WITH_CACHE:-0}" == "1" ]]; then + # Build phase keeps caches enabled; the run phase below switches to nocache + BUILD_VERSIONCACHE_OVERRIDES=() + echo "" + echo "--- Phase 1: Build only (BUILD_WITH_CACHE=1, caches enabled) ---" + else + echo "" + echo "--- Phase 1: Build only (NOCACHE) ---" + fi + + if [[ "${SKIP_SAVE_LOAD:-0}" == "1" ]]; then + # Single-process flow: build + search + insert in one SPTAGTest invocation. + # SkipSaveLoadCycles=true bypasses the broken post-build SaveIndex and per-batch + # Load/Clone/Save. SPTAGTest itself drops OS pagecache after build, before query. + echo "[SKIP_SAVE_LOAD=1] running build + search + insert in a single SPTAGTest process" + local SINGLE_INI + SINGLE_INI=$(generate_ini "$SCALE" 1 "${BUILD_MODE_OVERRIDES[@]}" \ + "SkipSaveLoadCycles=true" "${BUILD_VERSIONCACHE_OVERRIDES[@]}") || exit 1 + + ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$SINGLE_INI" \ + BENCHMARK_OUTPUT="output_${SCALE}_1node.json" \ + "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig 2>&1 ) \ + | tee "$LOGDIR/benchmark_${SCALE}_1node_driver.log" + + echo "Done: $(date)" + tikv_stop 1 + return 0 + fi + + local BUILD_INI + BUILD_INI=$(generate_ini "$SCALE" 1 "${BUILD_MODE_OVERRIDES[@]}" "BuildOnly=true" "${BUILD_VERSIONCACHE_OVERRIDES[@]}") || exit 1 + + ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$BUILD_INI" \ + BENCHMARK_OUTPUT="output_${SCALE}_1node_build.json" \ + "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig 2>&1 ) \ + | tee "$LOGDIR/benchmark_${SCALE}_1node_build.log" + + echo "Build done: $(date)" + + if [[ "${BUILD_WITH_CACHE:-0}" == "1" && "${SKIP_TIKV_SWAP:-0}" != "1" ]]; then + echo "" + echo "--- Phase 1.4: Switch TiKV to nocache config ---" + tikv_switch_to_nocache 1 + elif [[ "${SKIP_TIKV_SWAP:-0}" == "1" ]]; then + echo "[SKIP_TIKV_SWAP=1] keeping TiKV containers running; relying on drop_caches + VersionCache=0" + fi + + echo "" + echo "--- Phase 1.5: Drop all caches (NOCACHE) ---" + drop_all_caches 1 + + echo "" + echo "--- Phase 2: Search+Insert (cold cache) ---" + local RUN_INI + RUN_INI=$(generate_ini "$SCALE" 1 "Rebuild=false" "VersionCacheTTLMs=0" "VersionCacheMaxChunks=0") || exit 1 + + ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$RUN_INI" \ + BENCHMARK_OUTPUT="output_${SCALE}_1node.json" \ + "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig 2>&1 ) \ + | tee "$LOGDIR/benchmark_${SCALE}_1node_driver.log" + else + echo "" + echo "--- Phase 1: Single-node run ---" + local INI + INI=$(generate_ini "$SCALE" 1 "${BUILD_MODE_OVERRIDES[@]}") || exit 1 + + echo "Starting driver on ${NODE_HOSTS[0]}..." + ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$INI" \ + BENCHMARK_OUTPUT="output_${SCALE}_1node.json" \ + "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig 2>&1 ) \ + | tee "$LOGDIR/benchmark_${SCALE}_1node_driver.log" + fi + + echo "Done: $(date)" + tikv_stop 1 + else + # ─── Multi-node flow ─── + echo "" + echo "--- Phase 0: Prepare TiKV ($NODE_COUNT instances) ---" + tikv_stop "$NODE_COUNT" + tikv_clean "$NODE_COUNT" + if ! tikv_start "$NODE_COUNT"; then + echo "ERROR: tikv_start failed; aborting benchmark." >&2 + return 1 + fi + + # --- Phase 1: Build index on driver --- + echo "" + echo "--- Phase 1: Build index on driver ---" + local BUILD_INI + local NOCACHE_OVERRIDES=() + local BUILD_NOCACHE_OVERRIDES=() + if [[ "${NOCACHE:-0}" == "1" ]]; then + NOCACHE_OVERRIDES=("VersionCacheTTLMs=0" "VersionCacheMaxChunks=0" "WorkerTimeout=14400") + if [[ "${BUILD_WITH_CACHE:-0}" == "1" ]]; then + # Build with cache, only run phase is nocache + BUILD_NOCACHE_OVERRIDES=() + echo "[BUILD_WITH_CACHE=1] build phase keeps caches; will switch before run phase" + else + BUILD_NOCACHE_OVERRIDES=("${NOCACHE_OVERRIDES[@]}") + fi + fi + + # Resolve build mode before cleaning (SKIP_HEAD_BUILD needs existing dir) + resolve_build_mode "$SCALE" "$NODE_COUNT" + + if [[ " ${BUILD_MODE_OVERRIDES[*]} " != *"RebuildSSDOnly=true"* ]]; then + # Full build: clean old index dirs on all nodes + for (( i=0; i "$BUILD_LOG" 2>&1 & + local BUILD_PID=$! + echo " Driver build PID: $BUILD_PID" + + # Shell-side watchdog: if the driver dies unexpectedly (segfault, OOM, + # SIGKILL) we want a fast failure path rather than hanging forever. + WORKER_SSH_PIDS=() + start_driver_watchdog "$BUILD_PID" "$NODE_COUNT" + + # Wait for the driver build to finish + echo " Waiting for driver build to complete..." + wait "$BUILD_PID" + local BUILD_RC=$? + echo "Driver build done (exit=$BUILD_RC): $(date)" + stop_driver_watchdog + + if [[ $BUILD_RC -ne 0 ]] || grep -q "===== SEGFAULT" "$BUILD_LOG"; then + echo "" + echo "ERROR: Build phase failed (exit=$BUILD_RC, segfault=$(grep -c '===== SEGFAULT' "$BUILD_LOG"))" + echo "Refusing to proceed to run phase with broken build state." + echo "Tail of build log:" + tail -30 "$BUILD_LOG" + tikv_stop "$NODE_COUNT" + exit 1 + fi + + echo "Build done: $(date)" + + # --- Phase 2: Distribute data --- + echo "" + echo "--- Phase 2: Distribute head index + data ---" + rm -f "$DATA_DIR/proidx_${SCALE}_${NODE_COUNT}node/spann_index/checkpoint.txt" + + distribute_head_index "$SCALE" "$NODE_COUNT" + distribute_perftest_files "$NODE_COUNT" + + # Sync SPTAGTest binary + bundled runtime libs to all workers so + # they pick up the latest compiled changes. (cmd_deploy is a separate + # subcommand; without this step a stale binary on the worker silently + # diverges from the driver.) + echo "" + echo "Syncing SPTAGTest binary + runtime_libs to workers..." + for host in "${NODE_HOSTS[@]}"; do + if [ "$host" = "${NODE_HOSTS[0]}" ]; then continue; fi + remote_exec "$host" "mkdir -p $SPTAG_DIR/Release" + remote_sync "$host" "$SPTAG_DIR/Release/SPTAGTest" "$SPTAG_DIR/Release/SPTAGTest" + if [ -d "$SPTAG_DIR/Release/runtime_libs" ]; then + remote_exec "$host" "mkdir -p $SPTAG_DIR/Release/runtime_libs" + rsync -az -e "ssh $(_ssh_opts)" \ + "$SPTAG_DIR/Release/runtime_libs/" \ + "$SSH_USER@$host:$SPTAG_DIR/Release/runtime_libs/" + fi + done + + # Binary already pushed; nothing else to do here. + + # --- Phase 3: Start driver first (contains dispatcher), then workers --- + echo "" + + # Drop caches if NOCACHE mode + if [[ "${NOCACHE:-0}" == "1" ]]; then + if [[ "${BUILD_WITH_CACHE:-0}" == "1" && "${SKIP_TIKV_SWAP:-0}" != "1" ]]; then + echo "--- Phase 2.4: Switch TiKV to nocache config ---" + tikv_switch_to_nocache "$NODE_COUNT" + elif [[ "${SKIP_TIKV_SWAP:-0}" == "1" ]]; then + echo "[SKIP_TIKV_SWAP=1] keeping TiKV containers running; relying on drop_caches + VersionCache=0" + fi + echo "--- Phase 2.5: Drop all caches (NOCACHE) ---" + drop_all_caches "$NODE_COUNT" + fi + + echo "--- Phase 3: Distributed run ---" + + local RUN_INI + RUN_INI=$(generate_ini "$SCALE" "$NODE_COUNT" "Rebuild=false" "${NOCACHE_OVERRIDES[@]}") || exit 1 + + # Start driver in background first — it contains the dispatcher that + # workers need to connect to for ring registration. + local DRIVER_LOG="$LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_driver.log" + echo "Starting driver (dispatcher+worker0) on ${NODE_HOSTS[0]}..." + ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$RUN_INI" \ + BENCHMARK_OUTPUT="output_${SCALE}_${NODE_COUNT}node.json" \ + "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig ) \ + > "$DRIVER_LOG" 2>&1 & + local DRIVER_PID=$! + echo " Driver PID: $DRIVER_PID" + + # Wait for dispatcher to start listening before launching workers + local DISP_PORT=30001 + echo " Waiting for dispatcher to listen on port $DISP_PORT..." + for attempt in $(seq 1 60); do + if ss -tlnp 2>/dev/null | grep -q ":${DISP_PORT} " || \ + netstat -tlnp 2>/dev/null | grep -q ":${DISP_PORT} "; then + echo " Dispatcher listening (${attempt}s)" + break + fi + if ! kill -0 "$DRIVER_PID" 2>/dev/null; then + echo " ERROR: Driver exited prematurely" + cat "$DRIVER_LOG" + return 1 + fi + if [ "$attempt" -eq 60 ]; then + echo " WARNING: Dispatcher not detected on port $DISP_PORT after 60s, proceeding anyway" + fi + sleep 1 + done + + # Now start remote workers — they can connect to the dispatcher + WORKER_SSH_PIDS=() + for (( i=1; i/dev/null || true + done + + tikv_stop "$NODE_COUNT" + fi + + echo "" + echo "═══════════════════════════════════════════════════" + echo " ${SCALE} ${NODE_COUNT}-node done: $(date)" + echo " Results: output_${SCALE}_${NODE_COUNT}node.json" + echo " Logs: $LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_*.log" + echo "═══════════════════════════════════════════════════" +} + +cmd_bench() { + # Run 1-node baseline + N-node distributed for each specified scale. + # Usage: cmd_bench [scale...] + # Special scale "all" expands to all scales with templates in configs/. + local scales=() + for arg in "$@"; do + if [ "$arg" = "all" ]; then + for tmpl in "$SCRIPT_DIR"/configs/benchmark_*_template.ini; do + local name + name="$(basename "$tmpl")" + name="${name#benchmark_}" + name="${name%_template.ini}" + scales+=("$name") + done + else + scales+=("$arg") + fi + done + + if [ ${#scales[@]} -eq 0 ]; then + echo "Usage: $0 bench [scale...] | all" + echo "Available scales:" + for tmpl in "$SCRIPT_DIR"/configs/benchmark_*_template.ini; do + local name + name="$(basename "$tmpl")" + name="${name#benchmark_}" + name="${name%_template.ini}" + echo " $name" + done + exit 1 + fi + + echo "" + echo "═══════════════════════════════════════════════════" + echo " Benchmark suite: ${scales[*]}" + echo " Cluster: $TOTAL_NODES nodes" + echo " Start: $(date)" + echo "═══════════════════════════════════════════════════" + + for scale in "${scales[@]}"; do + echo "" + echo "▶▶▶ Scale: $scale — 1-node baseline" + cmd_run "$scale" 1 + + if [ "$TOTAL_NODES" -gt 1 ]; then + echo "" + echo "▶▶▶ Scale: $scale — ${TOTAL_NODES}-node distributed" + cmd_run "$scale" "$TOTAL_NODES" + else + echo " (Skipping multi-node: cluster has only 1 node)" + fi + done + + echo "" + echo "═══════════════════════════════════════════════════" + echo " Benchmark suite complete: $(date)" + echo "═══════════════════════════════════════════════════" +} + +# ─── Cleanup ─── + +cmd_cleanup() { + echo "" + echo "=== Cleaning up remote nodes ===" + + for i in $(seq 1 $((${#NODE_HOSTS[@]} - 1))); do + local host="${NODE_HOSTS[$i]}" + echo " Cleaning $host..." + remote_exec "$host" "rm -rf $SPTAG_DIR/Release/SPTAGTest $SPTAG_DIR/perftest_* $SPTAG_DIR/worker_*.ini" + # Clean index directories + remote_exec "$host" "rm -rf $DATA_DIR/proidx_*" + done + echo "Cleanup complete." +} + +# ─── Main ─── + +CMD="$1" +CONF="$2" + +if [ -z "$CMD" ] || [ -z "$CONF" ]; then + echo "Usage: $0 [args...]" + echo "" + echo "Commands:" + echo " deploy Deploy binary and data to all nodes" + echo " start-tikv Start independent TiKV/PD instances" + echo " stop-tikv Stop TiKV/PD instances" + echo " run Run benchmark: $0 run cluster.conf " + echo " bench Run full benchmark suite: $0 bench cluster.conf [scale...] | all" + echo " cleanup Remove deployed files from remote nodes" + exit 1 +fi + +parse_config "$CONF" + +# Trap for cleanup on interrupt +trap 'echo ""; echo "Interrupted!"; stop_driver_watchdog; stop_remote_workers 5; cmd_stop_tikv; exit 1' INT TERM + +case "$CMD" in + deploy) + cmd_deploy + ;; + setup-bins) + cmd_setup_bins + ;; + start-tikv) + cmd_start_tikv "${3:-}" + ;; + stop-tikv) + cmd_stop_tikv "${3:-}" + ;; + run) + cmd_run "$3" "$4" + ;; + bench) + shift 2 # skip cmd and conf + cmd_bench "$@" + ;; + cleanup) + cmd_cleanup + ;; + *) + echo "Unknown command: $CMD" + echo "Valid commands: deploy, setup-bins, start-tikv, stop-tikv, run, bench, cleanup" + exit 1 + ;; +esac From 418674711afefef9a7548136618940061343f0de Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 07:21:04 +0000 Subject: [PATCH 02/51] Fix unneede diff --- .gitignore | 3 +- Test/src/main.cpp | 5 +- benchmark.ini | 19 ----- .../configs/benchmark_100m_1node.ini | 71 ------------------- .../configs/benchmark_100m_2node.ini | 71 ------------------- .../configs/benchmark_10m_1node.ini | 62 ---------------- .../configs/benchmark_10m_2node.ini | 62 ---------------- .../benchmark_insert_dominant_1node.ini | 58 --------------- .../benchmark_insert_dominant_2node.ini | 58 --------------- .../benchmark_insert_dominant_3node.ini | 59 --------------- 10 files changed, 5 insertions(+), 463 deletions(-) delete mode 100644 benchmark.ini delete mode 100644 evaluation/distributed/configs/benchmark_100m_1node.ini delete mode 100644 evaluation/distributed/configs/benchmark_100m_2node.ini delete mode 100644 evaluation/distributed/configs/benchmark_10m_1node.ini delete mode 100644 evaluation/distributed/configs/benchmark_10m_2node.ini delete mode 100644 evaluation/distributed/configs/benchmark_insert_dominant_1node.ini delete mode 100644 evaluation/distributed/configs/benchmark_insert_dominant_2node.ini delete mode 100644 evaluation/distributed/configs/benchmark_insert_dominant_3node.ini diff --git a/.gitignore b/.gitignore index e3dc9796a..190ca29d3 100644 --- a/.gitignore +++ b/.gitignore @@ -464,5 +464,4 @@ FodyWeavers.xsd *.sln.iml # SPTAG benchmark generated artifacts -/perftest_* -/evaluation/2026-04-23/output_distributed_hostname_*.json +*perftest_* diff --git a/Test/src/main.cpp b/Test/src/main.cpp index ab8d1342c..49ca39950 100644 --- a/Test/src/main.cpp +++ b/Test/src/main.cpp @@ -7,7 +7,9 @@ #include #include +#ifdef TIKV #include +#endif using namespace boost::unit_test; @@ -36,8 +38,9 @@ struct GlobalFixture // adds GraphCycles bookkeeping under a global spinlock on every Lock(); // observed to consume ~12% CPU under high worker-thread parallelism in // gRPC client paths (perf-recorded 2026-05-06). +#ifdef TIKV absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore); - +#endif SPTAGVisitor visitor; traverse_test_tree(framework::master_test_suite(), visitor, false); } diff --git a/benchmark.ini b/benchmark.ini deleted file mode 100644 index e2b400767..000000000 --- a/benchmark.ini +++ /dev/null @@ -1,19 +0,0 @@ -[Benchmark] -VectorPath=sift1b/base.100M.u8bin -QueryPath=sift1b/query.public.10K.u8bin -TruthPath=none -IndexPath=proidx/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=10000 -InsertVectorCount=10000 -DeleteVectorCount=0 -BatchNum=10 -TopK=5 -NumThreads=8 -NumQueries=100 -DistMethod=L2 -Rebuild=true -Resume=-1 -QuantizerFilePath=quantizer.bin -QuantizedDim=64 diff --git a/evaluation/distributed/configs/benchmark_100m_1node.ini b/evaluation/distributed/configs/benchmark_100m_1node.ini deleted file mode 100644 index 42ec07f49..000000000 --- a/evaluation/distributed/configs/benchmark_100m_1node.ini +++ /dev/null @@ -1,71 +0,0 @@ -; 100m: 99M base + 1M insert (insert is ~1% of base, "freshness / steady-state" workload). -; 100× larger base index than insert_dominant. Tests how the system behaves when -; the head index is large (~tens of millions of heads on layer 0) and the insert -; rate is moderate. Layers=2, L2 distance, SIFT1B dataset. -; -; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from -; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). -; -; Notes for 100M-scale operation: -; - First run MUST build the index (Rebuild=true). Build of 99M base takes hours; -; reuse with Rebuild=false on subsequent runs and SKIP_HEAD_BUILD=1 if the -; HeadIndex on disk is intact. -; - Truth (top-5 over 99M) is recomputed at start each run; expect ~minutes. -; - SaveIndex at 100M has been observed to hang in BG-job-drain on some hosts; -; use SKIP_SAVE_LOAD=1 when iterating to bypass the per-batch save/load cycle. -; - TiKV data will grow to ~50-100GB per store at this scale; both nodes need -; plenty of NVMe headroom (verified: driver has 6.2T, worker has 691G). -[Benchmark] -WorkerTimeout=14400 -VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin -QueryPath=/mnt/nvme/sift1b/query.10K.u8bin -TruthPath=truth -IndexPath=/mnt/nvme/proidx_100m_1node/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=99000000 -InsertVectorCount=1000000 -DeleteVectorCount=0 -BatchNum=1 -TopK=5 -NumSearchThreads=4 -NumInsertThreads=4 -AppendThreadNum=16 -NumSearchDuringInsertThreads=1 -NumQueries=200 -DistMethod=L2 -Rebuild=true -BuildOnly=false -Resume=-1 -Layers=2 - -Storage=TIKVIO -TiKVPDAddresses=PLACEHOLDER -TiKVKeyPrefix=bench100m_1node - -[SelectHead] -ParallelBKTBuild=true - -[BuildHead] -ParallelBKTBuild=true - -[BuildSSDIndex] -LatencyLimit=100 -MaxCheck=8192 -SearchInternalResultNum=64 -UseMultiChunkPosting=false -PostingPageLimit=8 -PostingCountCacheCapacity=10000000 -SearchCheckVersionMapOnlyLayer0=true -DistributedVersionMap=true -ReassignK=64 -AsyncMergeInSearch=true -VersionCacheMaxChunks=1000000 -AsyncRpcMaxInflight=512 - -[Distributed] -Enabled=true -DispatcherAddr=10.11.0.7:30001 -WorkerAddrs=10.11.0.7:30011 -StoreAddrs=10.11.0.7:20171 -PDAddrs=10.11.0.7:23791 diff --git a/evaluation/distributed/configs/benchmark_100m_2node.ini b/evaluation/distributed/configs/benchmark_100m_2node.ini deleted file mode 100644 index 01b9c3e81..000000000 --- a/evaluation/distributed/configs/benchmark_100m_2node.ini +++ /dev/null @@ -1,71 +0,0 @@ -; 100m: 99M base + 1M insert (insert is ~1% of base, "freshness / steady-state" workload). -; 100× larger base index than insert_dominant. Tests how the system behaves when -; the head index is large (~tens of millions of heads on layer 0) and the insert -; rate is moderate. Layers=2, L2 distance, SIFT1B dataset. -; -; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from -; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). -; -; Notes for 100M-scale operation: -; - First run MUST build the index (Rebuild=true). Build of 99M base takes hours; -; reuse with Rebuild=false on subsequent runs and SKIP_HEAD_BUILD=1 if the -; HeadIndex on disk is intact. -; - Truth (top-5 over 99M) is recomputed at start each run; expect ~minutes. -; - SaveIndex at 100M has been observed to hang in BG-job-drain on some hosts; -; use SKIP_SAVE_LOAD=1 when iterating to bypass the per-batch save/load cycle. -; - TiKV data will grow to ~50-100GB per store at this scale; both nodes need -; plenty of NVMe headroom (verified: driver has 6.2T, worker has 691G). -[Benchmark] -WorkerTimeout=14400 -VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin -QueryPath=/mnt/nvme/sift1b/query.10K.u8bin -TruthPath=truth -IndexPath=/mnt/nvme/proidx_100m_2node/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=99000000 -InsertVectorCount=1000000 -DeleteVectorCount=0 -BatchNum=1 -TopK=5 -NumSearchThreads=4 -NumInsertThreads=4 -AppendThreadNum=16 -NumSearchDuringInsertThreads=1 -NumQueries=200 -DistMethod=L2 -Rebuild=false -BuildOnly=false -Resume=-1 -Layers=2 - -Storage=TIKVIO -TiKVPDAddresses=PLACEHOLDER -TiKVKeyPrefix=bench100m_2node - -[SelectHead] -ParallelBKTBuild=true - -[BuildHead] -ParallelBKTBuild=true - -[BuildSSDIndex] -LatencyLimit=100 -MaxCheck=8192 -SearchInternalResultNum=64 -UseMultiChunkPosting=false -PostingPageLimit=8 -PostingCountCacheCapacity=10000000 -SearchCheckVersionMapOnlyLayer0=true -DistributedVersionMap=true -ReassignK=64 -AsyncMergeInSearch=true -VersionCacheMaxChunks=1000000 -AsyncRpcMaxInflight=512 - -[Distributed] -Enabled=true -DispatcherAddr=10.11.0.7:30001 -WorkerAddrs=10.11.0.7:30011,10.11.0.10:30002 -StoreAddrs=10.11.0.7:20171,10.11.0.10:20171 -PDAddrs=10.11.0.7:23791,10.11.0.10:23791 diff --git a/evaluation/distributed/configs/benchmark_10m_1node.ini b/evaluation/distributed/configs/benchmark_10m_1node.ini deleted file mode 100644 index 56dbd9088..000000000 --- a/evaluation/distributed/configs/benchmark_10m_1node.ini +++ /dev/null @@ -1,62 +0,0 @@ -; 10m: 9M base + 1M insert (insert is ~10% of base, "growing-index" workload). -; 10× larger base index than insert_dominant, 10× smaller than 100m. -; Useful for validating scaling between 1M and 100M without paying the -; multi-hour build cost of 100m. Layers=2, L2 distance, SIFT1B dataset -; (truncated to 10M of the 1B available). -; -; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from -; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). -[Benchmark] -WorkerTimeout=14400 -VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin -QueryPath=/mnt/nvme/sift1b/query.10K.u8bin -TruthPath=truth -IndexPath=/mnt/nvme/proidx_10m_1node/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=9000000 -InsertVectorCount=1000000 -DeleteVectorCount=0 -BatchNum=1 -TopK=5 -NumSearchThreads=4 -NumInsertThreads=4 -AppendThreadNum=16 -NumSearchDuringInsertThreads=1 -NumQueries=200 -DistMethod=L2 -Rebuild=true -BuildOnly=false -Resume=-1 -Layers=2 - -Storage=TIKVIO -TiKVPDAddresses=PLACEHOLDER -TiKVKeyPrefix=bench10m_1node - -[SelectHead] -ParallelBKTBuild=true - -[BuildHead] -ParallelBKTBuild=true - -[BuildSSDIndex] -LatencyLimit=100 -MaxCheck=8192 -SearchInternalResultNum=64 -UseMultiChunkPosting=false -PostingPageLimit=8 -PostingCountCacheCapacity=1000000 -SearchCheckVersionMapOnlyLayer0=true -DistributedVersionMap=true -ReassignK=64 -AsyncMergeInSearch=true -VersionCacheMaxChunks=1000000 -AsyncRpcMaxInflight=512 - -[Distributed] -Enabled=true -DispatcherAddr=10.11.0.7:30001 -WorkerAddrs=10.11.0.7:30011 -StoreAddrs=10.11.0.7:20171 -PDAddrs=10.11.0.7:23791 diff --git a/evaluation/distributed/configs/benchmark_10m_2node.ini b/evaluation/distributed/configs/benchmark_10m_2node.ini deleted file mode 100644 index 4ed317ac3..000000000 --- a/evaluation/distributed/configs/benchmark_10m_2node.ini +++ /dev/null @@ -1,62 +0,0 @@ -; 10m: 9M base + 1M insert (insert is ~10% of base, "growing-index" workload). -; 10× larger base index than insert_dominant, 10× smaller than 100m. -; Useful for validating scaling between 1M and 100M without paying the -; multi-hour build cost of 100m. Layers=2, L2 distance, SIFT1B dataset -; (truncated to 10M of the 1B available). -; -; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from -; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). -[Benchmark] -WorkerTimeout=14400 -VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin -QueryPath=/mnt/nvme/sift1b/query.10K.u8bin -TruthPath=truth -IndexPath=/mnt/nvme/proidx_10m_2node/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=9000000 -InsertVectorCount=1000000 -DeleteVectorCount=0 -BatchNum=1 -TopK=5 -NumSearchThreads=4 -NumInsertThreads=4 -AppendThreadNum=16 -NumSearchDuringInsertThreads=1 -NumQueries=200 -DistMethod=L2 -Rebuild=false -BuildOnly=false -Resume=-1 -Layers=2 - -Storage=TIKVIO -TiKVPDAddresses=PLACEHOLDER -TiKVKeyPrefix=bench10m_2node - -[SelectHead] -ParallelBKTBuild=true - -[BuildHead] -ParallelBKTBuild=true - -[BuildSSDIndex] -LatencyLimit=100 -MaxCheck=8192 -SearchInternalResultNum=64 -UseMultiChunkPosting=false -PostingPageLimit=8 -PostingCountCacheCapacity=1000000 -SearchCheckVersionMapOnlyLayer0=true -DistributedVersionMap=true -ReassignK=64 -AsyncMergeInSearch=true -VersionCacheMaxChunks=1000000 -AsyncRpcMaxInflight=512 - -[Distributed] -Enabled=true -DispatcherAddr=10.11.0.7:30001 -WorkerAddrs=10.11.0.7:30011,10.11.0.10:30002 -StoreAddrs=10.11.0.7:20171,10.11.0.10:20171 -PDAddrs=10.11.0.7:23791,10.11.0.10:23791 diff --git a/evaluation/distributed/configs/benchmark_insert_dominant_1node.ini b/evaluation/distributed/configs/benchmark_insert_dominant_1node.ini deleted file mode 100644 index 30fe77bbe..000000000 --- a/evaluation/distributed/configs/benchmark_insert_dominant_1node.ini +++ /dev/null @@ -1,58 +0,0 @@ -; insert_dominant: 1M base + 1M insert with concurrent search-during-insert. -; Layers=2, L2 distance, SIFT1B dataset (truncated to 1M). -; -; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from -; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). -[Benchmark] -WorkerTimeout=14400 -VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin -QueryPath=/mnt/nvme/sift1b/query.10K.u8bin -TruthPath=truth -IndexPath=/mnt/nvme/proidx_insert_dominant_1node/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=1000000 -InsertVectorCount=1000000 -DeleteVectorCount=0 -BatchNum=1 -TopK=5 -NumSearchThreads=4 -NumInsertThreads=4 -AppendThreadNum=16 -NumSearchDuringInsertThreads=1 -NumQueries=200 -DistMethod=L2 -Rebuild=true -BuildOnly=false -Resume=-1 -Layers=2 - -Storage=TIKVIO -TiKVPDAddresses=PLACEHOLDER -TiKVKeyPrefix=benchinsert_dominant_1node - -[SelectHead] -ParallelBKTBuild=true - -[BuildHead] -ParallelBKTBuild=true - -[BuildSSDIndex] -LatencyLimit=100 -MaxCheck=8192 -SearchInternalResultNum=64 -UseMultiChunkPosting=false -PostingPageLimit=8 -PostingCountCacheCapacity=1000000 -SearchCheckVersionMapOnlyLayer0=true -DistributedVersionMap=true -ReassignK=64 -AsyncMergeInSearch=true -VersionCacheMaxChunks=100000 - -[Distributed] -Enabled=true -DispatcherAddr=10.11.0.7:30001 -WorkerAddrs=10.11.0.7:30011 -StoreAddrs=10.11.0.7:20171 -PDAddrs=10.11.0.7:23791 diff --git a/evaluation/distributed/configs/benchmark_insert_dominant_2node.ini b/evaluation/distributed/configs/benchmark_insert_dominant_2node.ini deleted file mode 100644 index d45870b50..000000000 --- a/evaluation/distributed/configs/benchmark_insert_dominant_2node.ini +++ /dev/null @@ -1,58 +0,0 @@ -; insert_dominant: 1M base + 1M insert with concurrent search-during-insert. -; Layers=2, L2 distance, SIFT1B dataset (truncated to 1M). -; -; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from -; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). -[Benchmark] -WorkerTimeout=14400 -VectorPath=/mnt/nvme/sift1b/bigann_base.u8bin -QueryPath=/mnt/nvme/sift1b/query.10K.u8bin -TruthPath=truth -IndexPath=/mnt/nvme/proidx_insert_dominant_2node/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=1000000 -InsertVectorCount=1000000 -DeleteVectorCount=0 -BatchNum=1 -TopK=5 -NumSearchThreads=4 -NumInsertThreads=4 -AppendThreadNum=16 -NumSearchDuringInsertThreads=1 -NumQueries=200 -DistMethod=L2 -Rebuild=false -BuildOnly=false -Resume=-1 -Layers=2 - -Storage=TIKVIO -TiKVPDAddresses=PLACEHOLDER -TiKVKeyPrefix=benchinsert_dominant_2node - -[SelectHead] -ParallelBKTBuild=true - -[BuildHead] -ParallelBKTBuild=true - -[BuildSSDIndex] -LatencyLimit=100 -MaxCheck=8192 -SearchInternalResultNum=64 -UseMultiChunkPosting=false -PostingPageLimit=8 -PostingCountCacheCapacity=1000000 -SearchCheckVersionMapOnlyLayer0=true -DistributedVersionMap=true -ReassignK=64 -AsyncMergeInSearch=true -VersionCacheMaxChunks=100000 - -[Distributed] -Enabled=true -DispatcherAddr=10.11.0.7:30001 -WorkerAddrs=10.11.0.7:30011,10.11.0.10:30002 -StoreAddrs=10.11.0.7:20171,10.11.0.10:20171 -PDAddrs=10.11.0.7:23791,10.11.0.10:23791 diff --git a/evaluation/distributed/configs/benchmark_insert_dominant_3node.ini b/evaluation/distributed/configs/benchmark_insert_dominant_3node.ini deleted file mode 100644 index a8050732d..000000000 --- a/evaluation/distributed/configs/benchmark_insert_dominant_3node.ini +++ /dev/null @@ -1,59 +0,0 @@ -; insert_dominant: 1M base + 10M insert (10× scale-up) with concurrent search-during-insert. -; Tests how the index handles insertion-dominated workloads where insertion volume -; is much larger than the initial baseline. Layers=2, L2 distance, SIFT1B dataset. -; -; Multi-machine deployment: run_distributed.sh fills PLACEHOLDER fields from -; cluster.conf (IndexPath, TiKVKeyPrefix, TiKVPDAddresses, [Distributed] addrs). -[Benchmark] -WorkerTimeout=14400 -VectorPath=/mnt/data/sift1b/base.1B.u8bin -QueryPath=/mnt/data/sift1b/query.public.10K.u8bin -TruthPath=truth -IndexPath=/mnt/md0/proidx_insert_dominant_3node/spann_index -ValueType=UInt8 -Dimension=128 -BaseVectorCount=1000000 -InsertVectorCount=1000000 -DeleteVectorCount=0 -BatchNum=1 -TopK=5 -NumSearchThreads=4 -NumInsertThreads=4 -AppendThreadNum=16 -NumSearchDuringInsertThreads=1 -NumQueries=200 -DistMethod=L2 -Rebuild=false -BuildOnly=false -Resume=-1 -Layers=2 - -Storage=TIKVIO -TiKVPDAddresses=PLACEHOLDER -TiKVKeyPrefix=benchinsert_dominant_3node - -[SelectHead] -ParallelBKTBuild=true - -[BuildHead] -ParallelBKTBuild=true - -[BuildSSDIndex] -LatencyLimit=100 -MaxCheck=8192 -SearchInternalResultNum=64 -UseMultiChunkPosting=false -PostingPageLimit=8 -PostingCountCacheCapacity=1000000 -SearchCheckVersionMapOnlyLayer0=true -DistributedVersionMap=true -ReassignK=64 -AsyncMergeInSearch=true -VersionCacheMaxChunks=100000 - -[Distributed] -Enabled=true -DispatcherAddr=172.27.0.4:30001 -WorkerAddrs=172.27.0.4:30011,172.27.0.5:30002,172.27.0.6:30003 -StoreAddrs=172.27.0.4:20171,172.27.0.5:20171,172.27.0.6:20171 -PDAddrs=172.27.0.4:23791,172.27.0.5:23791,172.27.0.6:23791 From ee97d3ff732f69c91c2b35158219c5f3f1873187 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 08:21:07 +0000 Subject: [PATCH 03/51] Remove unused stride-shard experiment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Strip the SPFRESH_SHARD_STRIDE opt-in code path (4 helpers + plumbing through LoadAndInsertBatch/RunBenchmark/RunWorker). No active config sets the env var; we always use the contiguous slice partition. Test/CMakeLists.txt: explicitly link ${TiKV_LIBRARIES} into SPTAGTest so a clean build (no .o cache) resolves gpr_/grpc_ symbols pulled in by the kvproto generated stubs. ThirdParty/kvproto/.gitignore: stop tracking regenerated stubs going forward — they are environment-specific (must match the protoc/grpc in the build env); regenerate locally via generate_cpp.sh. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Test/CMakeLists.txt | 2 +- Test/src/SPFreshTest.cpp | 148 ++-------------------- ThirdParty/kvproto/.gitignore | 4 + evaluation/distributed/run_distributed.sh | 1 - 4 files changed, 19 insertions(+), 136 deletions(-) create mode 100644 ThirdParty/kvproto/.gitignore diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index 27bdeebb5..9db640da2 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -24,7 +24,7 @@ if (NOT LIBRARYONLY) file(GLOB TEST_HDR_FILES ${PROJECT_SOURCE_DIR}/Test/inc/Test.h) file(GLOB TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/Test/src/*.cpp) add_executable(SPTAGTest ${TEST_SRC_FILES} ${TEST_HDR_FILES}) - target_link_libraries(SPTAGTest SPTAGLibStatic ssdservingLib ${Boost_LIBRARIES} absl_synchronization absl_cord absl_cordz_info absl_cord_internal absl_cordz_functions absl_cordz_handle) + target_link_libraries(SPTAGTest SPTAGLibStatic ssdservingLib ${Boost_LIBRARIES} ${TiKV_LIBRARIES} absl_synchronization absl_cord absl_cordz_info absl_cord_internal absl_cordz_functions absl_cordz_handle) install(TARGETS SPTAGTest RUNTIME DESTINATION bin diff --git a/Test/src/SPFreshTest.cpp b/Test/src/SPFreshTest.cpp index 9ab420db9..1a2140773 100644 --- a/Test/src/SPFreshTest.cpp +++ b/Test/src/SPFreshTest.cpp @@ -62,94 +62,6 @@ static __attribute__((constructor)) void install_segfault_handler() { using namespace SPTAG; -// --------------------------------------------------------------------------- -// Stride sharding (a.k.a. odd/even sharding) experiment -// --------------------------------------------------------------------------- -// When the env var SPFRESH_SHARD_STRIDE is set to "1"/"true", each node, instead -// of inserting a contiguous slice [n*B/N, (n+1)*B/N) of the per-iteration batch, -// inserts the strided rows {n, n+N, n+2*N, ...} where n=nodeIndex, N=numNodes. -// This breaks any spatial structure in the input dataset (e.g. SIFT files that -// are roughly sorted by visual feature), letting us check whether the layer-0 -// split skew (driver 71 vs worker 2 in v18) is caused by contiguous slicing -// landing similar vectors on the same node and overflowing a small set of heads. -// -// The total number of vectors inserted across all nodes per iteration is the -// same; only the assignment changes. Recall measurement still works because -// the dataset and ground truth are unchanged — only insert routing differs. -static bool IsStrideShardEnabled() { - const char* e = std::getenv("SPFRESH_SHARD_STRIDE"); - if (!e) return false; - std::string v(e); - return v == "1" || v == "true" || v == "TRUE" || v == "yes"; -} - -// Compute count of indices i in [0, total) with (i % stride) == offset. -static SizeType StrideCount(SizeType total, int stride, int offset) { - if (stride <= 1) return total; - if (offset < 0 || offset >= stride) return 0; - if (total <= offset) return 0; - return (total - 1 - offset) / stride + 1; -} - -// Build a strided sub-VectorSet by copying every `stride`-th vector starting -// at `offset` into a contiguous packed ByteArray. Returns a BasicVectorSet. -static std::shared_ptr ExtractStridedVectors( - const std::shared_ptr& full, int stride, int offset) -{ - if (!full) return nullptr; - SizeType totalCount = full->Count(); - SizeType outCount = StrideCount(totalCount, stride, offset); - auto vt = full->GetValueType(); - auto dim = full->Dimension(); - size_t perVecSize = full->PerVectorDataSize(); - if (outCount <= 0) { - return std::make_shared(ByteArray::Alloc(0), vt, dim, 0); - } - ByteArray buf = ByteArray::Alloc(static_cast(outCount) * perVecSize); - for (SizeType i = 0; i < outCount; ++i) { - SizeType srcIdx = static_cast(offset) + i * static_cast(stride); - std::memcpy(buf.Data() + static_cast(i) * perVecSize, - full->GetVector(srcIdx), - perVecSize); - } - return std::make_shared(buf, vt, dim, outCount); -} - -// Build a strided sub-MetadataSet. Two-pass: first compute offsets, then copy. -static std::shared_ptr ExtractStridedMetadata( - const std::shared_ptr& full, int stride, int offset) -{ - if (!full) return nullptr; - SizeType totalCount = full->Count(); - SizeType outCount = StrideCount(totalCount, stride, offset); - if (outCount <= 0) { - ByteArray emptyMeta = ByteArray::Alloc(0); - ByteArray offBuf = ByteArray::Alloc(sizeof(std::uint64_t)); - *reinterpret_cast(offBuf.Data()) = 0ULL; - return std::make_shared(emptyMeta, offBuf, 0); - } - std::vector offsets(static_cast(outCount) + 1, 0ULL); - std::uint64_t total = 0; - for (SizeType i = 0; i < outCount; ++i) { - SizeType srcIdx = static_cast(offset) + i * static_cast(stride); - ByteArray meta = full->GetMetadata(srcIdx); - offsets[i] = total; - total += meta.Length(); - } - offsets[outCount] = total; - ByteArray metaBuf = ByteArray::Alloc(total > 0 ? total : 1); - for (SizeType i = 0; i < outCount; ++i) { - SizeType srcIdx = static_cast(offset) + i * static_cast(stride); - ByteArray meta = full->GetMetadata(srcIdx); - if (meta.Length() > 0) { - std::memcpy(metaBuf.Data() + offsets[i], meta.Data(), meta.Length()); - } - } - ByteArray offBuf = ByteArray::Alloc((static_cast(outCount) + 1) * sizeof(std::uint64_t)); - std::memcpy(offBuf.Data(), offsets.data(), offsets.size() * sizeof(std::uint64_t)); - return std::make_shared(metaBuf, offBuf, outCount); -} - // Helper: parse "host:port,host:port,..." into vector of pairs. static std::vector> ParseNodeAddrs(const std::string& addrStr) { std::vector> result; @@ -1098,7 +1010,6 @@ void LoadAndInsertBatch(SPANN::Index* spannIndex, const std::string& paddmetaidx, int dimension, int insertStart, int loadCount, int perNodeBatch, - bool strideShard, int numNodes, int nodeIndex, int numInsertThreads, SPANN::WorkerNode* router, std::shared_ptr quantizer, @@ -1121,14 +1032,6 @@ void LoadAndInsertBatch(SPANN::Index* spannIndex, addFloat->Count()); } auto addmetaset = TestUtils::TestDataGenerator::LoadMetadataSet(paddmeta, paddmetaidx, insertStart, loadCount); - if (strideShard) { - addset = ExtractStridedVectors(addset, numNodes, nodeIndex); - addmetaset = ExtractStridedMetadata(addmetaset, numNodes, nodeIndex); - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "%s: stride-shard batchStart=%d loadCount=%d -> kept=%d (every %d-th, offset=%d)\n", - logPrefix, insertStart, loadCount, - (int)(addset ? addset->Count() : 0), numNodes, nodeIndex); - } InsertVectors(spannIndex, numInsertThreads, perNodeBatch, addset, addmetaset, searchDuringInsertThreads, queryset, numQueries, searchK, @@ -1225,23 +1128,12 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c // Use distributed config for multi-node partitioning int nodeIndex = distCfg.workerIndex; int numNodes = distCfg.GetNumWorkers(); - bool strideShard = IsStrideShardEnabled() && numNodes > 1; - int myInsertStart, myInsertEnd, perNodeBatch; - if (strideShard) { - // Stride mode: each node loads the FULL per-iter batch then keeps rows - // where (rowIdx % numNodes) == nodeIndex. myInsertStart/End span the - // full batch; perNodeBatch is the count of strided rows. - myInsertStart = 0; - myInsertEnd = insertBatchSize; - perNodeBatch = static_cast(StrideCount(insertBatchSize, numNodes, nodeIndex)); - } else { - myInsertStart = (numNodes > 1) ? (nodeIndex * insertBatchSize) / numNodes : 0; - myInsertEnd = (numNodes > 1) ? ((nodeIndex + 1) * insertBatchSize) / numNodes : insertBatchSize; - perNodeBatch = myInsertEnd - myInsertStart; - } + int myInsertStart = (numNodes > 1) ? (nodeIndex * insertBatchSize) / numNodes : 0; + int myInsertEnd = (numNodes > 1) ? ((nodeIndex + 1) * insertBatchSize) / numNodes : insertBatchSize; + int perNodeBatch = myInsertEnd - myInsertStart; SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "RunBenchmark: nodeIndex=%d numNodes=%d insertBatchSize=%d myInsertStart=%d myInsertEnd=%d perNodeBatch=%d strideShard=%d\n", - nodeIndex, numNodes, insertBatchSize, myInsertStart, myInsertEnd, perNodeBatch, strideShard ? 1 : 0); + "RunBenchmark: nodeIndex=%d numNodes=%d insertBatchSize=%d myInsertStart=%d myInsertEnd=%d perNodeBatch=%d\n", + nodeIndex, numNodes, insertBatchSize, myInsertStart, myInsertEnd, perNodeBatch); // Variables to collect JSON output data std::ostringstream tmpbenchmark; @@ -1585,19 +1477,16 @@ void RunBenchmark(const std::string &vectorPath, const std::string &queryPath, c SPANN::DispatchCommand::Type::Insert, static_cast(iter)); } - // Each node inserts its partition. Default mode: contiguous slice - // [iter*batchSize + myInsertStart, +perNodeBatch). Stride mode: - // every numNodes-th row of the full batch starting at nodeIndex - // (loads full batch then filters down to perNodeBatch rows). + // Each node inserts its contiguous slice + // [iter*batchSize + myInsertStart, +perNodeBatch). int insertStart = iter * insertBatchSize + myInsertStart; - int loadCount = strideShard ? insertBatchSize : perNodeBatch; + int loadCount = perNodeBatch; { std::string driverTag = "RunBenchmark iter=" + std::to_string(iter); start = std::chrono::high_resolution_clock::now(); LoadAndInsertBatch(static_cast*>(cloneIndex.get()), paddset, paddmeta, paddmetaidx, M, insertStart, loadCount, perNodeBatch, - strideShard, numNodes, nodeIndex, numInsertThreads, workerPtr, enableQuantization ? quantizer : nullptr, numSearchDuringInsertThreads, queryset, @@ -2914,17 +2803,9 @@ void RunWorker(const std::string& indexPath, int dimension, int baseVectorCount, int nodeIndex = distCfg.workerIndex; int numNodes = distCfg.GetNumWorkers(); int insertBatchSize = insertVectorCount / std::max(batches, 1); - bool strideShard = IsStrideShardEnabled() && numNodes > 1; - int myInsertStart, myInsertEnd, perNodeBatch; - if (strideShard) { - myInsertStart = 0; - myInsertEnd = insertBatchSize; - perNodeBatch = static_cast(StrideCount(insertBatchSize, numNodes, nodeIndex)); - } else { - myInsertStart = (numNodes > 1) ? (nodeIndex * insertBatchSize) / numNodes : 0; - myInsertEnd = (numNodes > 1) ? ((nodeIndex + 1) * insertBatchSize) / numNodes : insertBatchSize; - perNodeBatch = myInsertEnd - myInsertStart; - } + int myInsertStart = (numNodes > 1) ? (nodeIndex * insertBatchSize) / numNodes : 0; + int myInsertEnd = (numNodes > 1) ? ((nodeIndex + 1) * insertBatchSize) / numNodes : insertBatchSize; + int perNodeBatch = myInsertEnd - myInsertStart; BOOST_TEST_MESSAGE("Worker node " << nodeIndex << ": Loading index from " << indexPath); std::shared_ptr index; @@ -3035,16 +2916,15 @@ void RunWorker(const std::string& indexPath, int dimension, int baseVectorCount, if (cmd.m_type == SPANN::DispatchCommand::Type::Insert) { int insertStart = cmd.m_round * insertBatchSize + myInsertStart; - int loadCount = strideShard ? insertBatchSize : perNodeBatch; - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Batch %u - inserting %d vectors (offset %d, strideShard=%d)\n", - nodeIndex, cmd.m_round + 1, perNodeBatch, insertStart, strideShard ? 1 : 0); + int loadCount = perNodeBatch; + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Worker %d: Batch %u - inserting %d vectors (offset %d)\n", + nodeIndex, cmd.m_round + 1, perNodeBatch, insertStart); auto t1 = std::chrono::high_resolution_clock::now(); std::string workerTag = "Worker " + std::to_string(nodeIndex) + " batch=" + std::to_string(cmd.m_round + 1); LoadAndInsertBatch(spannIndex, paddset, paddmeta, paddmetaidx, dimension, insertStart, loadCount, perNodeBatch, - strideShard, numNodes, nodeIndex, numInsertThreads, router, /*quantizer=*/nullptr, /*searchDuringInsertThreads=*/0, diff --git a/ThirdParty/kvproto/.gitignore b/ThirdParty/kvproto/.gitignore new file mode 100644 index 000000000..b2dab26f7 --- /dev/null +++ b/ThirdParty/kvproto/.gitignore @@ -0,0 +1,4 @@ +# Generated C++ stubs are environment-specific (protoc/grpc versions must +# match the gRPC libs in the build env). Each developer should regenerate +# locally via generate_cpp.sh instead of consuming the committed snapshot. +generated/ diff --git a/evaluation/distributed/run_distributed.sh b/evaluation/distributed/run_distributed.sh index c383a7eed..bb982ab7d 100755 --- a/evaluation/distributed/run_distributed.sh +++ b/evaluation/distributed/run_distributed.sh @@ -744,7 +744,6 @@ start_remote_worker() { ssh -n $(_ssh_opts) "$SSH_USER@$host" \ "cd $SPTAG_DIR && LD_LIBRARY_PATH=$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:\${LD_LIBRARY_PATH:-} \ WORKER_INDEX=${NODE_IDX} BENCHMARK_CONFIG=worker_n${NODE_IDX}.ini \ - SPFRESH_SHARD_STRIDE=${SPFRESH_SHARD_STRIDE:-0} \ ./Release/SPTAGTest --run_test=SPFreshTest/BenchmarkFromConfig 2>&1" \ "$LOG" 2>&1 & local ssh_pid=$! From 4df704f9897ede7997e6632568f7362ebe893449 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 08:36:46 +0000 Subject: [PATCH 04/51] InsertVectors: dedupe branches, log InsertThreadNum ignore in bulk path The previous if/else duplicated the thread launch+join. Restructure to a single launch with an optional search-during-insert thread: - launch insertThreadCount workers - if benchmarking, launch one search thread in parallel - join all, then compute stats (only when search ran) Also log a clear note when the bulk router path is used: the user- supplied InsertThreadNum is unused there (driver runs one launcher thread and parallelism comes from [BuildSSDIndex] AppendThreadNum inside ExtraDynamicSearcher's append/split pool). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Test/src/SPFreshTest.cpp | 50 ++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/Test/src/SPFreshTest.cpp b/Test/src/SPFreshTest.cpp index 1a2140773..5bef228a3 100644 --- a/Test/src/SPFreshTest.cpp +++ b/Test/src/SPFreshTest.cpp @@ -661,29 +661,39 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step if (useBulk) { func = bulkFunc; insertThreadCount = 1; + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "InsertVectors: bulk path - driver launcher=1, internal parallelism comes from " + "[BuildSSDIndex] AppendThreadNum (user-supplied InsertThreadNum=%d is unused on this path)\n", + insertThreads); } else { func = perVecFunc; insertThreadCount = insertThreads; } - if (searchThreads > 0 && queryset != nullptr && numQueries != 0 && benchmarkData != nullptr) { - std::vector latencies; - std::vector results; - double searchWallSeconds = 0.0; + bool withSearch = (searchThreads > 0 && queryset != nullptr && numQueries != 0 && benchmarkData != nullptr); - for (int j = 0; j < insertThreadCount; j++) - { - threads.emplace_back(func); - } - std::thread searchThread([&]() { + for (int j = 0; j < insertThreadCount; j++) + { + threads.emplace_back(func); + } + + std::vector latencies; + std::vector results; + double searchWallSeconds = 0.0; + std::thread searchThread; + if (withSearch) { + searchThread = std::thread([&]() { searchWallSeconds = ExecutePartitionedSearch( p_index, queryset, /*myStart=*/0, numQueries, k, searchThreads, results, &latencies, /*statsOut=*/nullptr); }); - for (auto &thread : threads) - { - thread.join(); - } + } + + for (auto &thread : threads) + { + thread.join(); + } + if (withSearch) { searchThread.join(); // Calculate statistics @@ -712,17 +722,6 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step *benchmarkData << " \"minLatency\": " << minLat << ",\n"; *benchmarkData << " \"maxLatency\": " << maxLat << ",\n"; *benchmarkData << " \"qps\": " << qps << ",\n"; - } else { - // No search-during-insert path: just run the insert threads. - // (Used by worker dispatch and any caller that doesn't need stats.) - for (int j = 0; j < insertThreadCount; j++) - { - threads.emplace_back(func); - } - for (auto &thread : threads) - { - thread.join(); - } } auto barrierStart = std::chrono::high_resolution_clock::now(); size_t barrierPolls = 0; @@ -743,9 +742,6 @@ void InsertVectors(SPANN::Index *p_index, int insertThreads, int step } - - - template void BenchmarkQueryPerformance(std::shared_ptr &index, std::shared_ptr &queryset, std::shared_ptr &truth, const std::string &truthPath, From c27a109ac297d350521478b15bcb2e33b7e1827a Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 09:10:14 +0000 Subject: [PATCH 05/51] Restore (layers+1) multiplier in BlockController IO queue size 87160070 removed the (m_layers+1) multiplier in the SPDK BlockController queue-depth formula. The change was based on an incorrect assumption that the distributed port collapses all per-layer SPDK pools into the single shared layer-0 pool. In practice only layer 0 + the RPC receiver share a pool; every inner layer (m_layer >= 1) still creates its own SPDKThreadPool in both BuildIndex and LoadIndex. With Layers=2 (current active configs) we therefore have ~2 independent pools each running insert + reassign + append worker threads, so the peak concurrent IO-submitter count remains the qianxi-original (layers+1)*(insert+reassign+append) plus search threads. Under-sizing the BlockController queue could stall IO submission under heavy split/reassign + search load; over-sizing is harmless. Restore the multiplier to match qianxi behaviour. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/src/Core/SPANN/ExtraFileController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AnnService/src/Core/SPANN/ExtraFileController.cpp b/AnnService/src/Core/SPANN/ExtraFileController.cpp index b5db83822..24c839455 100644 --- a/AnnService/src/Core/SPANN/ExtraFileController.cpp +++ b/AnnService/src/Core/SPANN/ExtraFileController.cpp @@ -25,7 +25,7 @@ bool FileIO::BlockController::Initialize(SPANN::Options &p_opt, int p_layer) #ifndef _MSC_VER O_RDWR | O_DIRECT, numblocks, 2, 2, max(p_opt.m_ioThreads, (2 * max(p_opt.m_searchThreadNum, p_opt.m_iSSDNumberOfThreads) + - p_opt.m_insertThreadNum + p_opt.m_reassignThreadNum + p_opt.m_appendThreadNum)), + (p_opt.m_layers + 1) * (p_opt.m_insertThreadNum + p_opt.m_reassignThreadNum + p_opt.m_appendThreadNum))), ((std::uint64_t)p_opt.m_startFileSize) << 30 #else GENERIC_READ | GENERIC_WRITE, numblocks, 2, 2, From f3a9de98da29a208ef8eeb7311ad6c433bcfd21b Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 09:23:17 +0000 Subject: [PATCH 06/51] SetVersionBatch: bypass LRU cache, read TiKV directly All distributed runs override VersionCacheMaxChunks=0 (set by run_distributed.sh in build/run/nocache phases), so the LRU cache is effectively disabled. Using ReadChunkCached inside SetVersionBatch adds bookkeeping noise (cache hit/miss path, refresh-mutex acquire) that produces no benefit. Switch to direct ReadChunk; the dirty-byte gating still saves the WriteChunk RPC when no version byte actually changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/inc/Core/Common/TiKVVersionMap.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AnnService/inc/Core/Common/TiKVVersionMap.h b/AnnService/inc/Core/Common/TiKVVersionMap.h index 69191fe1b..ff30306e8 100644 --- a/AnnService/inc/Core/Common/TiKVVersionMap.h +++ b/AnnService/inc/Core/Common/TiKVVersionMap.h @@ -386,7 +386,10 @@ namespace SPTAG } // Group writes by chunk: 1 ReadChunk + N byte-modifications + 1 WriteChunk - // per chunk, instead of N × (ReadChunk + WriteChunk). + // per chunk, instead of N × (ReadChunk + WriteChunk). Bypasses the LRU + // cache because runs that exercise this path always have + // VersionCacheMaxChunks=0; reading TiKV directly removes a layer of + // bookkeeping (cache invalidate-on-write) we no longer benefit from. void SetVersionBatch(const std::vector& vids, const std::vector& versions) override { size_t n = std::min(vids.size(), versions.size()); @@ -408,7 +411,7 @@ namespace SPTAG SizeType cid = kv.first; auto& idxs = kv.second; std::lock_guard lock(ChunkMutex(cid)); - std::string chunk = ReadChunkCached(cid); + std::string chunk = ReadChunk(cid); if (chunk.empty()) { chunk.assign(m_chunkSize, static_cast(0xff)); } From f35ae85bdb46d25d51585061de47c63b312f48c1 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 09:42:39 +0000 Subject: [PATCH 07/51] Drop high-priority job queue from SPDKThreadPool The distributed port introduced a separate m_highJobs queue + add_high in ThreadPool plus 'urgent' parameters on AppendAsync/ReassignAsync. Receiver dispatch already discovered high-priority starved Split jobs and switched to high=false. The remaining urgent=true callers were: - AppendAsync in CollectReAssign's non-TiKV branch (dead under Storage::TIKVIO which is the only storage we use) - ReassignAsync on head-miss in Append/BatchAppend (same starvation risk against Split that motivated the receiver-side revert) Restore ThreadPool.h to the upstream deque+addfront shape (no semantic change vs. original) and drop the urgent parameter from AppendAsync/ ReassignAsync, the high flag from JobSubmitter, and the high path from WireJobSubmitterIfReady. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemotePostingOps.h | 27 ++++++--------- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 29 +++++----------- AnnService/inc/Helper/ThreadPool.h | 33 +++++-------------- 3 files changed, 28 insertions(+), 61 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 577b91876..0f032c2ba 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -95,7 +95,7 @@ namespace SPTAG::SPANN { // its own m_splitThreadPool, so BatchAppend items dispatch by the // request's m_layer to the matching pool. A single submitter would // pile both layers' remote appends into whichever pool wired last. - using JobSubmitter = std::function; + using JobSubmitter = std::function; void SetJobSubmitter(int layer, JobSubmitter submitter) { std::unique_lock lk(m_callbackLifetimeMutex); EnsureLayerSlot_NoLock(layer); @@ -756,13 +756,12 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "RemotePostingOps: Received batch of %u appends\n", batchReq->m_count); - // Submit each item as a high-priority Job to the searcher's - // shared compute pool. Pool workers run the local Append callback - // exactly like a local insert would. Last completion ACKs the - // sender. This puts remote work on the SAME concurrency budget - // as local Split/Merge/Reassign — eliminating the over-subscribed - // TiKV behaviour of the old separate bg executor + transient - // sub-worker threads. + // Submit each item as a Job to the searcher's shared compute pool. + // Pool workers run the local Append callback exactly like a local + // insert would. Last completion ACKs the sender. This puts remote + // work on the SAME concurrency budget as local Split/Merge/Reassign + // — eliminating the over-subscribed TiKV behaviour of the old + // separate bg executor + transient sub-worker threads. auto packetPtr = std::make_shared(std::move(packet)); const size_t total = batchReq->m_items.size(); if (total == 0) { @@ -810,15 +809,9 @@ namespace SPTAG::SPANN { // submitter we have. for (auto& s : m_jobSubmitters) { if (s) { sub = &s; break; } } } - // Normal priority. Per-layer routing (m_jobSubmitters[layer]) - // already isolates layer-N append items from other layers' - // pools. High priority starved split entirely (split:N - // in_flight, 0 completed) because once all 16 worker threads - // are running long-tail append items, fresh high-prio appends - // keep cutting in front of split. Append throughput per chunk - // is limited by pool concurrency × per-item RMW; widen the - // pool (AppendThreadNum) instead of using priority hacks. - if (sub) (*sub)(job, /*high=*/false); + // Per-layer routing (m_jobSubmitters[layer]) isolates layer-N + // append items from other layers' pools. + if (sub) (*sub)(job); else { delete job; failCount->fetch_add(1); remaining->fetch_sub(1); } } } diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 29129bdb4..b8ca98e85 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -395,10 +395,7 @@ namespace SPTAG::SPANN { if (!m_worker || !m_splitThreadPool) return; auto pool = m_splitThreadPool; m_worker->SetJobSubmitter(m_layer, - [pool](Helper::ThreadPool::Job* j, bool high) { - if (high) pool->add_high(j); - else pool->add(j); - }); + [pool](Helper::ThreadPool::Job* j) { pool->add(j); }); } /// Set the external WorkerNode pointer and bind all callbacks @@ -436,7 +433,7 @@ namespace SPTAG::SPANN { // Mirror sender's version map for the records we're about // to persist so MergePostings + SearchIndex don't drop - // them as "stale". See HEAD git history for rationale. + // them as "stale". { const uint8_t* basePtr = reinterpret_cast(appendPosting.data()); size_t totalRec = appendPosting.size() / m_vectorInfoSize; @@ -1713,28 +1710,20 @@ namespace SPTAG::SPANN { m_splitThreadPool->add(curJob); } - inline void AppendAsync(SizeType headID, std::shared_ptr postingList, bool urgent = false,std::function p_callback = nullptr) + inline void AppendAsync(SizeType headID, std::shared_ptr postingList, std::function p_callback = nullptr) { auto* curJob = new AppendAsyncJob(this, headID, std::move(postingList), p_callback); m_appendJobsInFlight++; m_totalAppendSubmitted++; - if (urgent) { - m_splitThreadPool->addfront(curJob); - } else { - m_splitThreadPool->add(curJob); - } + m_splitThreadPool->add(curJob); } - inline void ReassignAsync(std::shared_ptr vectorInfo, SizeType headPrev, bool urgent = false, std::function p_callback = nullptr) + inline void ReassignAsync(std::shared_ptr vectorInfo, SizeType headPrev, std::function p_callback = nullptr) { auto* curJob = new ReassignAsyncJob(this, std::move(vectorInfo), headPrev, p_callback); m_reassignJobsInFlight++; m_totalReassignSubmitted++; - if (urgent) { - m_splitThreadPool->addfront(curJob); - } else { - m_splitThreadPool->add(curJob); - } + m_splitThreadPool->add(curJob); } ErrorCode CollectReAssign(ExtraWorkSpace *p_exWorkSpace, SizeType headID, std::shared_ptr headVec, @@ -1901,7 +1890,7 @@ namespace SPTAG::SPANN { if (m_opt->m_storage == Storage::TIKVIO) ret = BatchAppend(p_exWorkSpace, batchReassign, "CollectReAssign"); else { for (auto& kv : batchReassign) { - AppendAsync(kv.first, std::make_shared(kv.second), true); + AppendAsync(kv.first, std::make_shared(kv.second)); } } if (batchReassignCount > 0) { @@ -2019,7 +2008,7 @@ namespace SPTAG::SPANN { if (m_versionMap->GetVersion(VID) == version) { // SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Head Miss To ReAssign: VID: %d, current version: %d\n", *(int*)(&appendPosting[idx]), version); m_stat.m_headMiss++; - ReassignAsync(vectorInfo, headID, true); + ReassignAsync(vectorInfo, headID); } // SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Head Miss Do Not To ReAssign: VID: %d, version: %d, current version: %d\n", *(int*)(&appendPosting[idx]), m_versionMap->GetVersion(*(int*)(&appendPosting[idx])), version); } @@ -2185,7 +2174,7 @@ namespace SPTAG::SPANN { uint8_t version = *(uint8_t*)(ptr + sizeof(SizeType)); if (m_versionMap->GetVersion(VID) == version) { m_stat.m_headMiss++; - ReassignAsync(std::make_shared((char*)ptr, m_vectorInfoSize), headID, true); + ReassignAsync(std::make_shared((char*)ptr, m_vectorInfoSize), headID); } } continue; diff --git a/AnnService/inc/Helper/ThreadPool.h b/AnnService/inc/Helper/ThreadPool.h index a351a75c8..01c82e2a7 100644 --- a/AnnService/inc/Helper/ThreadPool.h +++ b/AnnService/inc/Helper/ThreadPool.h @@ -5,7 +5,7 @@ #define _SPTAG_HELPER_THREADPOOL_H_ #include -#include +#include #include #include #include @@ -78,42 +78,28 @@ namespace SPTAG { { std::lock_guard lock(m_lock); - m_jobs.push(j); + m_jobs.push_back(j); } m_cond.notify_one(); } - // High-priority push: jobs in m_highJobs always run before m_jobs. - // Used by the distributed receiver to let inbound BatchAppend RPC - // work jump ahead of local Split/Merge/Reassign so the sender - // (driver) doesn't time out waiting for the chunk ack while the - // local pool drains long-running rebalance work. - void add_high(Job* j) + void addfront(Job* j) { { std::lock_guard lock(m_lock); - m_highJobs.push(j); + m_jobs.push_front(j); } m_cond.notify_one(); } - // Alias kept for compatibility with code that calls addfront() - // (e.g., split-async path). Same semantics as add_high. - void addfront(Job* j) { add_high(j); } - bool get(Job*& j) { std::unique_lock lock(m_lock); - while (m_jobs.empty() && m_highJobs.empty() && !m_abort.ShouldAbort()) m_cond.wait(lock); + while (m_jobs.empty() && !m_abort.ShouldAbort()) m_cond.wait(lock); if (!m_abort.ShouldAbort()) { - if (!m_highJobs.empty()) { - j = m_highJobs.front(); - m_highJobs.pop(); - } else { - j = m_jobs.front(); - m_jobs.pop(); - } + j = m_jobs.front(); currentJobs++; + m_jobs.pop_front(); return true; } return false; @@ -122,7 +108,7 @@ namespace SPTAG size_t jobsize() { std::lock_guard lock(m_lock); - return m_jobs.size() + m_highJobs.size(); + return m_jobs.size(); } inline uint32_t runningJobs() { return currentJobs; } @@ -136,8 +122,7 @@ namespace SPTAG protected: std::atomic_uint32_t currentJobs{ 0 }; - std::queue m_jobs; - std::queue m_highJobs; + std::deque m_jobs; Abort m_abort; std::mutex m_lock; std::condition_variable m_cond; From a49b26d5292b90c7ccd2ead91fb71176b8e5ae4b Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 09:58:06 +0000 Subject: [PATCH 08/51] Fix space --- Test/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test/src/main.cpp b/Test/src/main.cpp index 49ca39950..c1a5cde60 100644 --- a/Test/src/main.cpp +++ b/Test/src/main.cpp @@ -39,7 +39,7 @@ struct GlobalFixture // observed to consume ~12% CPU under high worker-thread parallelism in // gRPC client paths (perf-recorded 2026-05-06). #ifdef TIKV - absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore); + absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore); #endif SPTAGVisitor visitor; traverse_test_tree(framework::master_test_suite(), visitor, false); From 689e5b23e45da738b7ff77830a59283d0a58c5e4 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 10:06:24 +0000 Subject: [PATCH 09/51] Fix distributed benchmark README + drop dead orchestrator code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run_distributed.sh: - Remove wait_workers_ready() — dead since the driver-listens-on-30001 handshake replaced log-grep readiness detection. - Drop the stale 'Binary already pushed; nothing else to do here' comment that sat immediately after the actual binary-push rsync block. README.md: - Correct the TiKV deployment model: the cluster is SHARED (all PDs in one raft group, all TiKVs registered as stores, max-replicas=1) — not one isolated PD+TiKV per node as the old text claimed. Architecture diagram, port table, and pre-split helper updated accordingly (one PD endpoint, not a per-node loop). - Fix Step 1 cluster-config path: configs/cluster_2node.conf (an actual shipped file), not the non-existent cluster.conf.example. - Update port defaults to match cluster_2node.conf (23791/23801/20171) and call out that the driver's router_port must not collide with the dispatcher port 30001 (cluster_2node.conf uses 30011 for this reason). - List all shipped configs (10m, 100m, insert_dominant, tikv.toml, cluster_*.conf) in the file table. - Document setup-bins subcommand alongside deploy. - Flag the Build / Distribute / Run split as a workaround for the missing distributed SelectHead/BuildHead implementation, so readers don't mistake it for the steady-state design. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- evaluation/distributed/README.md | 219 +++++++++++++--------- evaluation/distributed/run_distributed.sh | 33 ---- 2 files changed, 126 insertions(+), 126 deletions(-) diff --git a/evaluation/distributed/README.md b/evaluation/distributed/README.md index 1f24bc865..4717efc35 100644 --- a/evaluation/distributed/README.md +++ b/evaluation/distributed/README.md @@ -1,18 +1,26 @@ # Distributed Benchmark Evaluation — Insert Dominant Multi-machine SPTAG SPANN distributed benchmark for an **insert-dominant** workload -(1M base + 10M inserts in 10 batches, with concurrent search-during-insert) on -SIFT1B. Each physical node runs its own independent PD + TiKV (no shared Raft -replication — see "TiKV deployment model" below). +(1M base + 1M-10M inserts in batches, with concurrent search-during-insert) on +SIFT1B. All nodes share a single TiKV raft cluster (see "TiKV deployment model" +below). ## Files in this folder | File | Purpose | | --- | --- | -| `configs/benchmark_insert_dominant_template.ini` | Benchmark template; `run_distributed.sh` fills `IndexPath`, `TiKVPDAddresses`, `TiKVKeyPrefix`, and `[Distributed]` from `cluster.conf`. | -| `run_distributed.sh` | Orchestrator: `deploy` / `start-tikv` / `run` / `stop-tikv` / `cleanup`. | +| `configs/benchmark_insert_dominant_template.ini` | 1M base + 1M insert, search-during-insert workload. | +| `configs/benchmark_10m_template.ini` | 9M base + 1M insert, growing-index workload. | +| `configs/benchmark_100m_template.ini` | 99M base + 1M insert, steady-state/freshness workload. | +| `configs/cluster_2node.conf`, `configs/cluster_3node.conf` | Example cluster topologies. Pick one (or write your own) and pass to the orchestrator. | +| `configs/tikv.toml` | TiKV server config baked into the containers. | +| `run_distributed.sh` | Orchestrator: `deploy` / `setup-bins` / `start-tikv` / `run` / `bench` / `stop-tikv` / `cleanup`. | +| `bin/` | `tikv-server` + `pd-server` binaries used by the containers (`setup-bins` downloads them if missing). | | `README.md` | This file. | +`run_distributed.sh` fills the template's `IndexPath`, `TiKVPDAddresses`, +`TiKVKeyPrefix`, and `[Distributed]` section from the cluster config. + ## Architecture ``` @@ -29,35 +37,42 @@ replication — see "TiKV deployment model" below). │ + Router│ │ + Router│ │ + Router│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ │ │ - ▼ ▼ ▼ - ┌──────────┐ ┌──────────┐ ┌──────────┐ - │ TiKV 1 │ │ TiKV 2 │ │ TiKV N │ (one PD + one TiKV per node) - └──────────┘ └──────────┘ └──────────┘ + └────────────┼────────────┘ + ▼ + ┌───────────────────┐ + │ Shared TiKV raft │ N PDs (one raft group) + + │ cluster │ N TiKV stores (max-replicas=1) + └───────────────────┘ ``` -- **Driver** (node 0): Builds the index, sends Search/Insert/Stop commands via TCP dispatch. -- **Workers** (nodes 1..N): Receive commands, execute their shard locally, report results back. -- **TiKV (per node)**: Each node runs its own independent PD + TiKV pair. Postings - for a head live on the node that owns that head's hash partition. -- **PostingRouter**: Hash-based head routing, remote append, head sync, dispatch protocol. +- **Driver** (node 0): builds the index, sends Search/Insert/Stop commands via + TCP dispatch. +- **Workers** (nodes 1..N): receive commands, execute their shard locally, + report results back over the dispatch channel. +- **Shared TiKV cluster**: every node runs a PD + TiKV container; all PDs join + one raft group, all TiKVs point to all PDs. PD routes each key to the store + that owns its region. +- **PostingRouter**: hash-based head routing, remote append, head sync, + dispatch protocol. ## TiKV deployment model -Unlike a single-machine multi-docker TiKV (3 PD + 3 TiKV behind 127.0.0.1 ports -22791-3 / 20161-3 sharing one Raft cluster), in this multi-machine setup **each -node runs its own isolated PD + TiKV pair** under host networking. Heads are -routed to nodes by hash, and each node's TiKV stores only its own shard. There -is no Raft replication between nodes (no cross-node region quorum), which is -intentional for insert-dominated benchmarks where Raft log overhead would dominate. +All nodes share **one** TiKV raft cluster: every node's PD joins the same raft +group, every node's TiKV registers as a store in that cluster, and PD routes +reads/writes to whichever store owns the region. `max-replicas=1` is set so +each region lives on exactly one store — we measure benchmark performance +without 3-way Raft replication. Compute nodes are stateless TiKV clients; they +read any posting through the shared client, so there is no cross-compute fetch +RPC during RNGSelection. -Per-node ports (defaults from `cluster.conf`): +Per-node ports (defaults from `configs/cluster_2node.conf`): -| Service | Port | Notes | +| Service | Default port | Notes | | --- | --- | --- | -| PD client | `2379` | Local app uses `:2379`. | -| PD peer | `2380` | Inter-PD; isolated cluster of 1 PD per node. | -| TiKV client | `20161` | The node-local SPTAG worker connects here. | -| Router | `30001+` | TCP dispatch / posting routing between nodes. | +| PD client | `23791` | TiKV client + `pd-ctl` connect here. | +| PD peer | `23801` | Inter-PD raft traffic. | +| TiKV client | `20171` | Per-node TiKV listens here. | +| Router | `30002+` | TCP dispatch / posting routing between nodes. **Driver's `router_port` must NOT be `30001`** — the dispatcher listens on `30001` and a collision will silently break worker registration. The shipped 2-node config uses `30011` on the driver for this reason. | ## Prerequisites @@ -69,45 +84,47 @@ Per-node ports (defaults from `cluster.conf`): cmake .. -DTIKV=ON -DTBB=ON -DCMAKE_BUILD_TYPE=Release -DGPU=OFF cmake --build . --target SPTAGTest -j$(nproc) ``` - *Note: building the full project may fail on the Java wrapper (`JAVASPTAGFileIO`) - due to a pre-existing `FileIOInterface.h` signature mismatch — the `SPTAGTest` - target alone is sufficient.* -- Passwordless SSH from driver to every other node (configure `ssh_key` in `cluster.conf`). + *Note: building the full project may fail on the Java wrapper + (`JAVASPTAGFileIO`) due to a pre-existing `FileIOInterface.h` signature + mismatch — the `SPTAGTest` target alone is sufficient.* +- Passwordless SSH from driver to every other node (configure `ssh_key` in + the cluster config). - Docker installed on every node (TiKV/PD run as containers in host network mode). - Same dataset path on every node (default `/mnt/nvme/sift1b/`): - `/mnt/nvme/sift1b/bigann_base.u8bin` (1B × 128 × u8) - `/mnt/nvme/sift1b/query.10K.u8bin` -- Same fast-storage path for index + TiKV data on every node (`data_dir` in `cluster.conf`, - default `/mnt/nvme`). +- Same fast-storage path for index + TiKV data on every node (`data_dir` in + the cluster config, default `/mnt/nvme`). ## Step 1 — Cluster config +Pick one of the shipped templates and edit it for your hosts/paths: + ```bash -cp evaluation/distributed/cluster.conf.example cluster.conf -vim cluster.conf +cp evaluation/distributed/configs/cluster_2node.conf my_cluster.conf +vim my_cluster.conf ``` -Example: +Layout: ```ini [cluster] ssh_user=superbench +ssh_key=/home/superbench/.ssh/id_rsa sptag_dir=/home/superbench/zhangt/SPTAG data_dir=/mnt/nvme -tikv_version=v7.5.1 -pd_version=v7.5.1 +tikv_version=v8.5.1 +pd_version=v8.5.1 [nodes] -# host router_port -10.0.1.1 30001 # driver (always first) -10.0.1.2 30002 # worker 1 -10.0.1.3 30003 # worker 2 +# host router_port (driver is first; router_port must not equal 30001) +10.0.1.1 30011 # driver +10.0.1.2 30002 # worker 1 [tikv] -# host pd_client pd_peer tikv_port -10.0.1.1 2379 2380 20161 -10.0.1.2 2379 2380 20161 -10.0.1.3 2379 2380 20161 +# host pd_client_port pd_peer_port tikv_port +10.0.1.1 23791 23801 20171 +10.0.1.2 23791 23801 20171 ``` `run_distributed.sh` reads this file to fill the template's `[Distributed]`, @@ -116,50 +133,49 @@ pd_version=v7.5.1 ## Step 2 — Deploy ```bash -./evaluation/distributed/run_distributed.sh deploy cluster.conf +./evaluation/distributed/run_distributed.sh deploy my_cluster.conf +./evaluation/distributed/run_distributed.sh setup-bins my_cluster.conf ``` -This rsyncs `Release/SPTAGTest` (and required shared libs) to every node and -ensures the per-node TiKV / PD data directories exist under `data_dir`. +`deploy` rsyncs `Release/SPTAGTest` (and required shared libs) to every node +and ensures per-node TiKV / PD data directories exist under `data_dir`. +`setup-bins` downloads `tikv-server` / `pd-server` into `bin/` on every node +(idempotent; skipped automatically by `start-tikv` if binaries are already +present). -## Step 3 — Start TiKV (per-node, independent) +## Step 3 — Start the shared TiKV cluster ```bash -./evaluation/distributed/run_distributed.sh start-tikv cluster.conf +./evaluation/distributed/run_distributed.sh start-tikv my_cluster.conf ``` -This starts one PD + one TiKV per node in host-network containers. Single-replica -placement (`max-replicas=1`) is set so we measure benchmark performance without -3-way Raft replication. +This starts one PD + one TiKV container per node in host-network mode and +joins them into a single raft cluster (`max-replicas=1`, no 3-way replication). -Health check (run on driver, repeat per node): +Health check (single PD endpoint is enough — the cluster is shared): ```bash -for ip in 10.0.1.1 10.0.1.2 10.0.1.3; do - curl -s "http://$ip:2379/pd/api/v1/stores" \ - | python3 -c 'import json,sys; print([s["store"]["state_name"] for s in json.load(sys.stdin)["stores"]])' -done -# Each node should report ['Up']. +curl -s "http://10.0.1.1:23791/pd/api/v1/stores" \ + | python3 -c 'import json,sys; print([s["store"]["state_name"] for s in json.load(sys.stdin)["stores"]])' +# Expected: ['Up', 'Up'] (one entry per TiKV store). ``` ### Pre-split & scatter (optional but recommended) -For the insert-dominant workload to spread region writes evenly across regions -within a node's TiKV, pre-split the keyspace at boundaries derived from -`DBKey(headID) = MaxID*layer + headID` little-endian byte 0. The TiKV raw key is -`TiKVKeyPrefix + "_" + uint32_le(DBKey)`; for multi-chunk it appends `\x00` / -`\x02` for chunk / count keys, but we split *only* on the head-key prefix so all -chunk and count variants for a head share a region. Boundaries used: `0x02, 0x04, -…, 0xfe` (127 split points → 128 regions). +For the insert-dominant workload, pre-split the keyspace so writes spread +evenly across regions and stores. Boundaries derive from +`DBKey(headID) = MaxID*layer + headID` little-endian byte 0; the TiKV raw key +is `TiKVKeyPrefix + "_" + uint32_le(DBKey)`. We split *only* on the head-key +prefix so all chunk/count variants for a head share a region. Used split +points: `0x02, 0x04, …, 0xfe` (127 split points → 128 regions). -Driver-side helper (each PD is independent, so run per node): +Since the cluster is shared, run the helper **once** against any PD endpoint: ```bash -PREFIX="bench_insert_dominant_3node" # keep in sync with KEY_PREFIX in run_distributed.sh -for ip in 10.0.1.1 10.0.1.2 10.0.1.3; do - PD="http://$ip:2379" - PDCTL=(docker run --rm --network host --entrypoint /pd-ctl pingcap/pd:v7.5.1 -u "$PD") - python3 - "$PREFIX" "${PDCTL[@]}" <<'PY' +PREFIX="bench_insert_dominant_2node" # keep in sync with KEY_PREFIX in run_distributed.sh +PD="http://10.0.1.1:23791" +PDCTL=(docker run --rm --network host --entrypoint /pd-ctl pingcap/pd:v8.5.1 -u "$PD") +python3 - "$PREFIX" "${PDCTL[@]}" <<'PY' import json, subprocess, sys prefix = sys.argv[1].encode() + b'_' pdctl = sys.argv[2:] @@ -172,48 +188,65 @@ for b in range(2, 256, 2): for r in json.loads(run(['region', 'scan']))['regions']: run(['operator', 'add', 'scatter-region', str(r['id'])]) PY -done ``` -Skip this on the very first run if you don't have load skew — `start-tikv` works -without it. For 1B-scale insert-dominant runs on a single node it materially -reduces head-region hot-spotting. +Skip this on the very first run if you don't have load skew — `start-tikv` +works without it. For 1B-scale insert-dominant runs it materially reduces +head-region hot-spotting. ## Step 4 — Run the benchmark ```bash # Single scale, explicit node count (driver + (N-1) workers): -./evaluation/distributed/run_distributed.sh run cluster.conf insert_dominant 3 +./evaluation/distributed/run_distributed.sh run my_cluster.conf insert_dominant 2 # Or sweep 1-node baseline + N-node distributed for one or more scales: -./evaluation/distributed/run_distributed.sh bench cluster.conf insert_dominant +./evaluation/distributed/run_distributed.sh bench my_cluster.conf insert_dominant +./evaluation/distributed/run_distributed.sh bench my_cluster.conf all ``` What `run` does: 1. **Build** (driver only): driver builds the index locally with router - *disabled* (`Rebuild=true`, no `[Router]`). Output goes to `…_n0/spann_index`. + *disabled* (`Rebuild=true`, no `[Distributed]`). Output goes to + `…_n0/spann_index`. Because the TiKV cluster is shared, the driver writes + all postings straight to TiKV via PD-routed RPCs — there is no need for a + distributed build phase. 2. **Distribute**: rsync head index + perftest files from driver to each worker. -3. **Workers**: SSH-launches `SPTAGTest` on each worker with `WORKER_INDEX=i` and - the per-node ini (router enabled, `Rebuild=false`). -4. **Driver**: relaunches `SPTAGTest` with router enabled, `Rebuild=false`. The - driver dispatches Insert / Search commands across batches via TCP. +3. **Workers**: SSH-launches `SPTAGTest` on each worker with `WORKER_INDEX=i` + and the per-node ini (router enabled, `Rebuild=false`). +4. **Driver**: relaunches `SPTAGTest` with router enabled, `Rebuild=false`. + The driver dispatches Insert / Search commands across batches via TCP. 5. **Collect**: driver sends Stop, joins worker logs into `benchmark_logs/`. -Useful environment overrides (see header of `run_distributed.sh`): - -- `NOCACHE=1` — disable TiKV block cache, OS pagecache, and `VersionCacheMaxChunks`. -- `BUILD_WITH_CACHE=1` — build with caches, then drop caches before search/insert (NOCACHE only). -- `SKIP_TIKV_SWAP=1` — when using `BUILD_WITH_CACHE`, skip the destructive TiKV - container restart that has corrupted recall at 100M scale. -- `SKIP_SAVE_LOAD=1` — skip post-build SaveIndex / per-batch Load+Clone+Save (NOCACHE only). -- `SKIP_HEAD_BUILD=1` — reuse existing HeadIndex if present (RebuildSSDOnly). +> The "build on the driver, then distribute and run" split is a workaround: +> we don't yet have a real distributed SelectHead/BuildHead implementation, so +> Phase 1 is single-node-with-shared-TiKV. The `BuildOnly=true` / +> `RebuildSSDOnly=true` / `SkipSaveLoadCycles=true` / +> `tikv_switch_to_nocache` / `drop_caches` choreography exists because of +> this split; it is not a feature of the steady-state design. + +Useful environment overrides (see the header of `run_distributed.sh` for the +authoritative list): + +- `NOCACHE=1` — disable TiKV block cache, OS pagecache, and + `VersionCacheMaxChunks` for the search/insert phase. +- `BUILD_WITH_CACHE=1` — build with caches enabled, then drop caches before + search/insert (requires `NOCACHE=1`). Used at 100M scale where building + under nocache is impractical. +- `SKIP_TIKV_SWAP=1` — with `BUILD_WITH_CACHE`, skip the destructive TiKV + container restart that has corrupted recall at 100M scale. Relies on + drop_caches + `VersionCacheMaxChunks=0` for nocache semantics. +- `SKIP_SAVE_LOAD=1` — skip the post-build SaveIndex / per-batch + Load+Clone+Save cycle (`SkipSaveLoadCycles=true`). Required at 100M scale. +- `SKIP_HEAD_BUILD=1` — reuse existing HeadIndex if present + (`RebuildSSDOnly=true`); falls back to full build if HeadIndex is missing. ## Step 5 — Stop / cleanup ```bash -./evaluation/distributed/run_distributed.sh stop-tikv cluster.conf -./evaluation/distributed/run_distributed.sh cleanup cluster.conf # remove deployed files +./evaluation/distributed/run_distributed.sh stop-tikv my_cluster.conf +./evaluation/distributed/run_distributed.sh cleanup my_cluster.conf # remove deployed files ``` ## Key knobs in `benchmark_insert_dominant_template.ini` diff --git a/evaluation/distributed/run_distributed.sh b/evaluation/distributed/run_distributed.sh index bb982ab7d..28404c8a3 100755 --- a/evaluation/distributed/run_distributed.sh +++ b/evaluation/distributed/run_distributed.sh @@ -751,37 +751,6 @@ start_remote_worker() { echo " Worker n${NODE_IDX} on $host (SSH PID: $ssh_pid, log: $LOG)" } -wait_workers_ready() { - local SCALE="$1" - local NODE_COUNT="$2" - local TIMEOUT=120 - - echo "Waiting for ${#WORKER_SSH_PIDS[@]} workers to be ready..." - for attempt in $(seq 1 $TIMEOUT); do - local all_ready=true - for i in $(seq 1 $((NODE_COUNT - 1))); do - local LOG="$LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_worker${i}.log" - if ! grep -q "Worker.*[Rr]eady\|Waiting for dispatch" "$LOG" 2>/dev/null; then - all_ready=false - fi - done - if $all_ready; then - echo " All workers ready (${attempt}s)" - return 0 - fi - # Check if any worker SSH process died - for idx in "${!WORKER_SSH_PIDS[@]}"; do - if ! kill -0 "${WORKER_SSH_PIDS[$idx]}" 2>/dev/null; then - echo " ERROR: Worker SSH PID ${WORKER_SSH_PIDS[$idx]} exited prematurely" - return 1 - fi - done - sleep 1 - done - echo " WARNING: Not all workers ready after ${TIMEOUT}s" - return 1 -} - stop_remote_workers() { # Wait for workers to self-exit (driver sends TCP Stop), then force-kill. local TIMEOUT=${1:-30} @@ -1140,8 +1109,6 @@ cmd_run() { fi done - # Binary already pushed; nothing else to do here. - # --- Phase 3: Start driver first (contains dispatcher), then workers --- echo "" From ee405d4ddff4ec218c6a827eb4084087d96432cc Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 10:09:08 +0000 Subject: [PATCH 10/51] README: clarify driver = worker 0 + dispatcher; workers peer-to-peer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous wording made it sound like the driver was a stateless coordinator and workers only talked back to it. Reality: node 0 runs as worker 0 (owns its hash shard like every other worker) and additionally hosts the dispatcher; workers talk to each other directly through PostingRouter for remote append, head sync, and merge hints — no driver-mediated forwarding. Diagram and 'What run does' steps updated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- evaluation/distributed/README.md | 55 +++++++++++++++++++------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/evaluation/distributed/README.md b/evaluation/distributed/README.md index 4717efc35..2b9c0950e 100644 --- a/evaluation/distributed/README.md +++ b/evaluation/distributed/README.md @@ -24,20 +24,23 @@ below). ## Architecture ``` - ┌──────────────┐ - │ Driver │ (node 0) - │ RunBenchmark│ - │ + Router │ - └──┬───┬───┬──┘ - TCP Dispatch│ │ │ - ┌────────┘ │ └────────┐ - ▼ ▼ ▼ + ┌────────────────────┐ + │ Driver = Worker 0│ (node 0) + │ + Dispatcher │ + └─┬──┬──┬────────────┘ + TCP Dispatch │ │ │ ▲ ▲ ▲ + (broadcast) │ │ │ │ │ │ status replies + ┌──────┘ │ └──────┐│ │ │ + ▼ ▼ ▼│ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ Worker 1 │ │ Worker 2 │ │ Worker N │ - │ + Router│ │ + Router│ │ + Router│ - └────┬─────┘ └────┬─────┘ └────┬─────┘ - │ │ │ - └────────────┼────────────┘ + └──┬───▲───┘ └──┬───▲───┘ └──┬───▲───┘ + │ │ │ │ │ │ + └───┴────────┴───┴────────┴───┘ + PostingRouter peer-to-peer + (remote append / head sync / + merge hints, by hash owner) + │ ▼ ┌───────────────────┐ │ Shared TiKV raft │ N PDs (one raft group) + @@ -45,15 +48,19 @@ below). └───────────────────┘ ``` -- **Driver** (node 0): builds the index, sends Search/Insert/Stop commands via - TCP dispatch. -- **Workers** (nodes 1..N): receive commands, execute their shard locally, - report results back over the dispatch channel. +- **Driver** (node 0): also runs as **worker 0**. On top of the worker role, + it owns the dispatcher: builds the initial index, then broadcasts + Search/Insert/Stop commands to the other workers over TCP dispatch. +- **Workers** (nodes 0..N-1): each owns a shard of the head index by hash. + Workers talk to each other peer-to-peer through PostingRouter for remote + append, head sync, and merge hints — there is no driver-mediated forwarding. + On each `DispatchCommand` they execute the local part of the request and + report status back to the dispatcher. - **Shared TiKV cluster**: every node runs a PD + TiKV container; all PDs join one raft group, all TiKVs point to all PDs. PD routes each key to the store that owns its region. -- **PostingRouter**: hash-based head routing, remote append, head sync, - dispatch protocol. +- **PostingRouter**: hash-based head routing, remote append, head sync, and + the TCP dispatch transport used by the dispatcher. ## TiKV deployment model @@ -213,10 +220,14 @@ What `run` does: all postings straight to TiKV via PD-routed RPCs — there is no need for a distributed build phase. 2. **Distribute**: rsync head index + perftest files from driver to each worker. -3. **Workers**: SSH-launches `SPTAGTest` on each worker with `WORKER_INDEX=i` - and the per-node ini (router enabled, `Rebuild=false`). -4. **Driver**: relaunches `SPTAGTest` with router enabled, `Rebuild=false`. - The driver dispatches Insert / Search commands across batches via TCP. +3. **Workers**: SSH-launches `SPTAGTest` on each remote worker (nodes 1..N-1) + with `WORKER_INDEX=i` and the per-node ini (router enabled, + `Rebuild=false`). Workers wire PostingRouter so they can reach every peer + directly for remote append / head sync. +4. **Driver**: relaunches `SPTAGTest` on node 0 with router enabled, + `Rebuild=false`. The same process acts as **worker 0** (owns its hash + shard like any other worker) **and** as the dispatcher (broadcasts Insert + / Search / Stop over TCP and waits for status replies). 5. **Collect**: driver sends Stop, joins worker logs into `benchmark_logs/`. > The "build on the driver, then distribute and run" split is a workaround: From 6cf7d36e922d01a86163377a1bbc5cdc3f07f6e8 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 10:10:26 +0000 Subject: [PATCH 11/51] README: drop unused TiKV pre-split helper section We never actually ran the pre-split/scatter helper in our benchmark runs. Keeping it in the doc gives the false impression that it's part of the recommended setup. Remove the whole section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- evaluation/distributed/README.md | 34 -------------------------------- 1 file changed, 34 deletions(-) diff --git a/evaluation/distributed/README.md b/evaluation/distributed/README.md index 2b9c0950e..7b2234908 100644 --- a/evaluation/distributed/README.md +++ b/evaluation/distributed/README.md @@ -167,40 +167,6 @@ curl -s "http://10.0.1.1:23791/pd/api/v1/stores" \ # Expected: ['Up', 'Up'] (one entry per TiKV store). ``` -### Pre-split & scatter (optional but recommended) - -For the insert-dominant workload, pre-split the keyspace so writes spread -evenly across regions and stores. Boundaries derive from -`DBKey(headID) = MaxID*layer + headID` little-endian byte 0; the TiKV raw key -is `TiKVKeyPrefix + "_" + uint32_le(DBKey)`. We split *only* on the head-key -prefix so all chunk/count variants for a head share a region. Used split -points: `0x02, 0x04, …, 0xfe` (127 split points → 128 regions). - -Since the cluster is shared, run the helper **once** against any PD endpoint: - -```bash -PREFIX="bench_insert_dominant_2node" # keep in sync with KEY_PREFIX in run_distributed.sh -PD="http://10.0.1.1:23791" -PDCTL=(docker run --rm --network host --entrypoint /pd-ctl pingcap/pd:v8.5.1 -u "$PD") -python3 - "$PREFIX" "${PDCTL[@]}" <<'PY' -import json, subprocess, sys -prefix = sys.argv[1].encode() + b'_' -pdctl = sys.argv[2:] -def run(args): return subprocess.check_output(pdctl + args, text=True) -def region_for(hex_key): return json.loads(run(['region', 'key', '--format=hex', hex_key]))['id'] -for b in range(2, 256, 2): - key = (prefix + bytes([b, 0, 0, 0])).hex() - rid = region_for(key) - run(['operator', 'add', 'split-region', str(rid), '--policy=usekey', '--keys', key]) -for r in json.loads(run(['region', 'scan']))['regions']: - run(['operator', 'add', 'scatter-region', str(r['id'])]) -PY -``` - -Skip this on the very first run if you don't have load skew — `start-tikv` -works without it. For 1B-scale insert-dominant runs it materially reduces -head-region hot-spotting. - ## Step 4 — Run the benchmark ```bash From 07bdc03a6b1c3e89944da005d96cc073b733acfd Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 20 May 2026 10:11:38 +0000 Subject: [PATCH 12/51] Clean comment --- AnnService/inc/Core/Common/FineGrainedLock.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/AnnService/inc/Core/Common/FineGrainedLock.h b/AnnService/inc/Core/Common/FineGrainedLock.h index 5cfad7ac6..1f7d1eab4 100644 --- a/AnnService/inc/Core/Common/FineGrainedLock.h +++ b/AnnService/inc/Core/Common/FineGrainedLock.h @@ -56,10 +56,6 @@ namespace SPTAG return GetLock(idx); } - // Per-posting lock identity. Two indices share a lock iff they are - // the same posting, so external callers can use `hash_func(a) == - // hash_func(b)` as a self-lock guard (e.g. in Split, to skip - // re-locking the same head VID). static inline unsigned hash_func(unsigned idx) { return idx; From f0d8fe5d473262637dbec4ae23bbdb851bcddcd5 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:11:31 +0000 Subject: [PATCH 13/51] Extract IsRemoteOwnedHead predicate for owner-ring checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three Split/Merge/Append code paths duplicated the same check: m_worker && m_worker->IsEnabled() && each with their own (or missing) m_layer != 0 gate. Split() at L878 and MergePostings() at L1336 were missing the layer gate entirely, so on a hypothetical multi-layer cluster they would have skipped local inner-layer ops (which never use owner-ring routing). Unify on a single predicate IsRemoteOwnedHead(headID, &nodeIndex) and gate every callsite on it: - TryRouteRemoteAppend (routing — populates nodeIndex) - Split (drop remote splits early) - MergePostings (defense-in-depth net) - SplitAsync / MergeAsync (don't burn a pool slot for jobs we'll drop) Addresses PR #448 L553 review comment 'Can we find somewhere to just identify once'. Also folds the L1336 'if refine is not there, do we still need the filter' question — the filter at MergePostings is now only a safety net behind the MergeAsync enqueue-time gate, so future RefineIndex removal won't change anything. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 77 +++++++++++-------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index b8ca98e85..77c96843c 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -547,6 +547,26 @@ namespace SPTAG::SPANN { m_worker->QueueRemoteAppend(nodeIndex, std::move(req)); } + // Single source of truth for "this head lives on a different node". + // Only the outer (head) layer participates in the owner-ring route; + // inner layers (m_layer > 0) hold per-node-local state with no + // shared VID space and no cross-node TiKV key contract, so they + // always answer false. When true, outNodeIndex (if not null) is + // populated with the owner's node index. + // + // Every Split / Merge / Append code path that might touch a head + // it doesn't own MUST gate on this predicate so the invariant + // (only owners mutate their own postings) is enforced in exactly + // one place. + bool IsRemoteOwnedHead(SizeType headID, int* outNodeIndex = nullptr) { + if (m_layer != 0) return false; + if (!m_worker || !m_worker->IsEnabled()) return false; + auto target = m_worker->GetOwner(headID); + if (target.isLocal) return false; + if (outNodeIndex) *outNodeIndex = target.nodeIndex; + return true; + } + // If headID is owned by a remote node, queue the append for that // node and return true; otherwise return false (caller continues // with local write logic). @@ -554,18 +574,9 @@ namespace SPTAG::SPANN { int appendNum, std::string posting, const void* headVecBytes = nullptr) { - if (!m_worker || !m_worker->IsEnabled()) return false; - // Only the outer (head) layer participates in the owner-ring - // route. Inner layers (m_layer > 0) hold per-node-local state - // (no shared head VID space, no cross-node TiKV key naming - // contract), so each node services its own inner layer - // independently. Without this gate inner-layer appends would - // also dispatch RPCs that the receiver can't meaningfully - // apply. - if (m_layer != 0) return false; - auto target = m_worker->GetOwner(headID); - if (target.isLocal) return false; - EnqueueRemoteAppend(target.nodeIndex, headID, appendNum, + int ownerNode = -1; + if (!IsRemoteOwnedHead(headID, &ownerNode)) return false; + EnqueueRemoteAppend(ownerNode, headID, appendNum, std::move(posting), headVecBytes); return true; } @@ -875,13 +886,10 @@ namespace SPTAG::SPANN { // Only the OWNER of headID should run Split. Remote-issued // splits get dropped early so we don't mutate a posting that // doesn't live on this node. - if (m_worker && m_worker->IsEnabled()) { - auto target = m_worker->GetOwner(headID); - if (!target.isLocal) { - std::unique_lock tmplock(m_splitListLock); - m_splitList.unsafe_erase(headID); - return ErrorCode::Success; - } + if (IsRemoteOwnedHead(headID)) { + std::unique_lock tmplock(m_splitListLock); + m_splitList.unsafe_erase(headID); + return ErrorCode::Success; } // Owner-side: wait for any in-flight remote-initiated lock on @@ -1237,7 +1245,7 @@ namespace SPTAG::SPANN { auto updateHeadBegin = std::chrono::high_resolution_clock::now(); if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); - if (!remoteCreated && db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { + if (db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete gc posting %lld\n", (std::int64_t)(newHeadVID)); } return ret; @@ -1333,13 +1341,12 @@ namespace SPTAG::SPANN { { // The owner runs its own merge passes. Skip when this head is // owned by another node — we'd just be racing the owner. - if (m_worker && m_worker->IsEnabled()) { - auto target = m_worker->GetOwner(headID); - if (!target.isLocal) { - std::unique_lock tmplock(m_mergeListLock); - m_mergeList.unsafe_erase(headID); - return ErrorCode::Success; - } + // (Defense in depth: MergeAsync already filters at enqueue, but + // ownership can change between enqueue and execution.) + if (IsRemoteOwnedHead(headID)) { + std::unique_lock tmplock(m_mergeListLock); + m_mergeList.unsafe_erase(headID); + return ErrorCode::Success; } WaitForRemoteBucketUnlocked(headID); @@ -1667,13 +1674,10 @@ namespace SPTAG::SPANN { inline void SplitAsync(SizeType headID, int postingSize, std::function p_callback = nullptr) { - // SPTAGLIB_LOG(Helper::LogLevel::LL_Info,"Into SplitAsync, current headID: %d, size: %d\n", headID, m_postingSizes.GetSize(headID)); - // tbb::concurrent_hash_map::const_accessor headIDAccessor; - // if (m_splitList.find(headIDAccessor, headID)) { - // return; - // } - // tbb::concurrent_hash_map::value_type workPair(headID, headID); - // m_splitList.insert(workPair); + // Don't enqueue split jobs for heads we don't own; the owner + // will detect oversize on its own. Skipping here avoids + // burning a thread-pool slot only to drop the job in Split(). + if (IsRemoteOwnedHead(headID)) return; { Helper::Concurrent::ConcurrentMap::value_type workPair(headID, postingSize); std::shared_lock tmplock(m_splitListLock); @@ -1694,6 +1698,11 @@ namespace SPTAG::SPANN { inline void MergeAsync(SizeType headID, std::function p_callback = nullptr) { + // Don't enqueue merge jobs for heads we don't own; the owner + // runs its own merge pass. Filtering here is the single + // upstream gate so MergePostings's owner check is only a + // defense-in-depth net. + if (IsRemoteOwnedHead(headID)) return; { std::shared_lock tmplock(m_mergeListLock); auto res = m_mergeList.insert(headID); From d55de5454e74c3fe74b4e8a2793f632f00eead9f Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:14:23 +0000 Subject: [PATCH 14/51] VersionMap extend: use stride formula capacity*numWorkers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Design specifies that when the local VersionMap lags behind a posting written by a remote peer, the lagging node catches up via AddBatch(capacity * numWorkers) This works because the global VID space is striped across worker nodes (VID % numWorkers == nodeID), so the peer's maxVID can be at most ~ localCount * numWorkers ahead of us. Extending in this large chunk amortizes many remote inserts into one capacity bump and keeps growth conflict-free. The previous EnsureVersionMapCoversPosting did AddBatch(maxVid+1-localCount), which is correct but causes thrashing — every remote append where maxVid happens to be slightly past localCount triggers a small extend. Floor at the exact-gap need so single-node builds (numWorkers <= 1) behave identically to before. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 77c96843c..c92630616 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -596,11 +596,27 @@ namespace SPTAG::SPANN { } if (maxVid >= localCount) { SizeType need = maxVid + 1 - localCount; - m_versionMap->AddBatch(need); + // Design contract: on the interleaved stride scheme each + // node owns globalVIDs satisfying VID % numWorkers == + // nodeID. The max VID a remote peer can have produced by + // now is approximately localCount * numWorkers, so when + // we lag behind we extend by capacity*numWorkers in one + // shot. This keeps capacity growth conflict-free (we + // amortize many remote inserts into one extension) and + // avoids the per-VID AddBatch(1) thrashing of the old + // exact-gap formula. + int numWorkers = GetNumWorkerNodes(); + SizeType extendBy = need; + if (numWorkers > 1) { + SizeType strideGrow = localCount * (SizeType)numWorkers; + if (strideGrow > extendBy) extendBy = strideGrow; + } + m_versionMap->AddBatch(extendBy); SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, - "%s: extended local versionMap by %lld (head=%lld maxVid=%lld localCount=%lld)\n", - p_caller, (std::int64_t)need, (std::int64_t)p_headID, - (std::int64_t)maxVid, (std::int64_t)localCount); + "%s: extended local versionMap by %lld (head=%lld maxVid=%lld localCount=%lld need=%lld numWorkers=%d)\n", + p_caller, (std::int64_t)extendBy, (std::int64_t)p_headID, + (std::int64_t)maxVid, (std::int64_t)localCount, + (std::int64_t)need, numWorkers); } } From 370386618cf6106d2a76a3ea5114d7bb0f0e327f Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:19:52 +0000 Subject: [PATCH 15/51] RemotePostingOps: move RPC chunk/retry/timeout/inflight into INI options The four magic constants buried in the RPC layer kChunkSize = 3000 (RemotePostingOps.h) attempt < 3 = retry (RemotePostingOps.h) wait_for(180s) = timeout (RemotePostingOps.h) kMaxInflightPerNode = 4 (WorkerNode.h) are now exposed as SPANN INI parameters under [SSDIndex]: RemoteAppendChunkSize (default 3000) RemoteAppendRetry (default 3) RemoteAppendTimeoutSec (default 180) RemoteAppendMaxInflight (default 4) Defaults preserve current behavior. Plumbing: - Options.h / ParameterDefinitionList.h: declare/register parameters - RemotePostingOps: hold values in atomics, expose Set/Get* setters - WorkerNode: forward setters; m_maxInflightPerNode is now atomic - ExtraDynamicSearcher::SetWorker: push m_opt->m_remoteAppend* once This unblocks per-deployment RPC tuning (e.g. larger chunks on low- latency clusters, shorter timeouts in CI) without recompiling, and removes the long historical comments documenting why the chunk size was changed 5 times during benchmarking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemotePostingOps.h | 65 +++++++++++-------- .../inc/Core/SPANN/Distributed/WorkerNode.h | 15 ++++- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 13 ++++ AnnService/inc/Core/SPANN/Options.h | 6 ++ .../inc/Core/SPANN/ParameterDefinitionList.h | 6 ++ 5 files changed, 77 insertions(+), 28 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 0f032c2ba..03851df1c 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -87,6 +87,18 @@ namespace SPTAG::SPANN { void SetNetwork(NetworkAccess* net) { m_net = net; } + // RPC tuning. All knobs are configurable via SPANN INI options + // (RemoteAppend{ChunkSize,Retry,TimeoutSec,MaxInflight}). Defaults + // are baked here to keep single-node / unconfigured paths working; + // SPANN::ExtraDynamicSearcher::SetWorker() pushes the option-driven + // values once the index is bound to a worker. + void SetRpcChunkSize(int v) { if (v > 0) m_rpcChunkSize.store(v, std::memory_order_relaxed); } + void SetRpcRetry(int v) { if (v > 0) m_rpcRetry.store(v, std::memory_order_relaxed); } + void SetRpcTimeoutSec(int v) { if (v > 0) m_rpcTimeoutSec.store(v, std::memory_order_relaxed); } + int GetRpcChunkSize() const { return m_rpcChunkSize.load(std::memory_order_relaxed); } + int GetRpcRetry() const { return m_rpcRetry.load(std::memory_order_relaxed); } + int GetRpcTimeoutSec() const { return m_rpcTimeoutSec.load(std::memory_order_relaxed); } + // Inject the searcher's shared compute pool. Receiver-side BatchAppend // work runs as Jobs on this pool so it shares a single bounded- // concurrency budget with local Append/Split/Merge/Reassign (instead @@ -285,26 +297,14 @@ namespace SPTAG::SPANN { { if (items.empty()) return ErrorCode::Success; - // Chunk the batch so a single RPC never exceeds kChunkSize items. - // Large batches (millions of items) cannot be processed by the - // receiver within a single timeout window, causing data loss - // when the request is dropped. Chunking keeps each RPC bounded. - // [v38] Reduced 50000 → 10000 to (a) shrink end-of-batch drain - // tail (final chunk no longer 14s wide) and (b) let multiple - // chunks pipeline on the receiver pool. - // [v43] Back to 50000 — v42 (10k) was throughput-best (906/s) - // but during-insert p50 was 222ms; v43 (50k) trades throughput - // (-22% → 704/s) for during-insert p50 (-36% → 141ms) and big - // recovery in post-insert r1 QPS (47→85). v44 (100k) blew up - // tail drain: a single 100k chunk took 116s on the receiver, - // making end-of-batch drain run 40+ min (vs 8 min at 50k). - // 50k is the sweet spot. - // [v47] With shared-pool receiver (BatchAppendItemJob on - // m_splitThreadPool), 50k chunks still occasionally exceed the - // 180s wait_for window under contention → "Timeout waiting for - // batch response" + retries. Drop to 10k so each RPC's worst-case - // receiver wall-clock is ~6× smaller and stays under the timeout. - constexpr size_t kChunkSize = 3000; + // Chunk the batch so a single RPC never exceeds the configured + // chunk size. Large batches (millions of items) cannot be + // processed by the receiver within a single timeout window, + // causing data loss when the request is dropped. Chunking keeps + // each RPC bounded. Tunable via SPANN option + // RemoteAppendChunkSize (default 3000). + const size_t kChunkSize = + std::max(1, (size_t)m_rpcChunkSize.load(std::memory_order_relaxed)); const size_t total = items.size(); size_t offset = 0; std::vector chunk; @@ -337,13 +337,15 @@ namespace SPTAG::SPANN { { if (items.empty()) return ErrorCode::Success; - for (int attempt = 0; attempt < 3; attempt++) { + const int kMaxAttempts = std::max(1, m_rpcRetry.load(std::memory_order_relaxed)); + const int kTimeoutSec = std::max(1, m_rpcTimeoutSec.load(std::memory_order_relaxed)); + for (int attempt = 0; attempt < kMaxAttempts; attempt++) { Socket::ConnectionID connID = m_net->GetPeerConnection(targetNodeIndex); if (connID == Socket::c_invalidConnectionID) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "RemotePostingOps: Cannot connect to node %d for batch (%d items, attempt %d)\n", targetNodeIndex, (int)items.size(), attempt + 1); - if (attempt < 2) continue; + if (attempt < kMaxAttempts - 1) continue; return ErrorCode::Fail; } @@ -381,9 +383,12 @@ namespace SPTAG::SPANN { m_net->GetClient()->SendPacket(connID, std::move(packet), MakeSendFailHandler(resID)); - // Generous timeout: 50k items * (~10ms TiKV roundtrip / 16 worker threads) - // = ~31s typical; cap at 180s to allow for lock contention with merges/splits. - auto status = future.wait_for(std::chrono::seconds(180)); + // Wait window comes from SPANN option RemoteAppendTimeoutSec + // (default 180s). Sized so a normal-load chunk (chunk_size + // items at ~10ms TiKV roundtrip / 16 worker threads ≈ tens of + // seconds) completes well under the cap, leaving headroom for + // lock contention with merges/splits. + auto status = future.wait_for(std::chrono::seconds(kTimeoutSec)); auto waitMs = std::chrono::duration_cast( std::chrono::steady_clock::now() - waitStart).count(); if (status == std::future_status::timeout) { @@ -397,7 +402,7 @@ namespace SPTAG::SPANN { // are signalled via MakeSendFailHandler (which sets the // promise to Fail, taking the "result != Success" path // below). - if (attempt < 2) continue; + if (attempt < kMaxAttempts - 1) continue; return ErrorCode::Fail; } @@ -1194,6 +1199,14 @@ namespace SPTAG::SPANN { NetworkAccess* m_net = nullptr; + // RPC tuning knobs. See SetRpcChunkSize/Retry/TimeoutSec. Defaults + // match historical hardcoded values; overridden via SPANN options + // by ExtraDynamicSearcher::SetWorker(). Stored as atomics so the + // batch sender can read them lock-free. + std::atomic m_rpcChunkSize{3000}; + std::atomic m_rpcRetry{3}; + std::atomic m_rpcTimeoutSec{180}; + // Per-layer callback registries. Indexed by ExtraDynamicSearcher layer // (m_layer at the call site). Resized lazily by SetXxxCallback. The // empty/null entry at layer 0 is preserved so a single-layer caller diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index 8af906fcc..d50edcfd5 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -134,6 +134,17 @@ namespace SPTAG::SPANN { void SetDispatchCallback(DispatchCallback cb) { m_dispatch.SetDispatchCallback(std::move(cb)); } void ClearDispatchCallback() { m_dispatch.ClearDispatchCallback(); } + // RPC tuning forwarders. See RemotePostingOps for semantics. + // MaxInflightPerNode caps how many auto-flush chunks may be on + // the wire to a given peer at once; chunk size/retry/timeout + // are forwarded directly into RemotePostingOps. + void SetRpcChunkSize(int v) { m_remoteOps.SetRpcChunkSize(v); } + void SetRpcRetry(int v) { m_remoteOps.SetRpcRetry(v); } + void SetRpcTimeoutSec(int v) { m_remoteOps.SetRpcTimeoutSec(v); } + void SetRpcMaxInflightPerNode(int v) { + if (v > 0) m_maxInflightPerNode.store(v, std::memory_order_relaxed); + } + // ---- Routing ---- RouteTarget GetOwner(SizeType headID) { @@ -246,7 +257,7 @@ namespace SPTAG::SPANN { // wave) can saturate the receiver's bg-executor pool instead of // queueing up serially behind a single per-node mutex. if (q.size() >= kAutoFlushThreshold - && m_perNodeInflight[nodeIndex] < kMaxInflightPerNode) { + && m_perNodeInflight[nodeIndex] < m_maxInflightPerNode.load(std::memory_order_relaxed)) { toFlush.swap(q); m_remoteQueueSize.fetch_sub(toFlush.size(), std::memory_order_relaxed); ++m_perNodeInflight[nodeIndex]; @@ -585,7 +596,7 @@ namespace SPTAG::SPANN { std::atomic m_inflightAppendFlushes{0}; std::unordered_map m_perNodeInflight; // guarded by m_appendQueueMutex static constexpr size_t kAutoFlushThreshold = 50000; - static constexpr int kMaxInflightPerNode = 4; + std::atomic m_maxInflightPerNode{4}; std::mutex& GetPerNodeAppendFlushMutex(int nodeIndex) { std::lock_guard lk(m_perNodeAppendFlushMutexMapLock); diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index c92630616..36d49bbfa 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -404,6 +404,19 @@ namespace SPTAG::SPANN { m_worker = router; if (!m_worker) return; + // Push RPC tuning from SPANN options (RemoteAppend*) so the + // hardcoded defaults in RemotePostingOps/WorkerNode get + // overridden by whatever the ini file specified. Pushing per + // SetWorker call (rather than once at WorkerNode construction) + // means a hot reconfigure via index reload picks up new + // values automatically. + if (m_opt) { + m_worker->SetRpcChunkSize(m_opt->m_remoteAppendChunkSize); + m_worker->SetRpcRetry(m_opt->m_remoteAppendRetry); + m_worker->SetRpcTimeoutSec(m_opt->m_remoteAppendTimeoutSec); + m_worker->SetRpcMaxInflightPerNode(m_opt->m_remoteAppendMaxInflight); + } + WireJobSubmitterIfReady(); // Claim ownership so the matching destructor's IfOwner check diff --git a/AnnService/inc/Core/SPANN/Options.h b/AnnService/inc/Core/SPANN/Options.h index 2c9c8865e..0bbe4a90a 100644 --- a/AnnService/inc/Core/SPANN/Options.h +++ b/AnnService/inc/Core/SPANN/Options.h @@ -127,6 +127,12 @@ namespace SPTAG { int m_versionCacheMaxChunks; int m_asyncRpcMaxInflight; + // Distributed RemotePostingOps RPC tuning + int m_remoteAppendChunkSize; + int m_remoteAppendRetry; + int m_remoteAppendTimeoutSec; + int m_remoteAppendMaxInflight; + // GPU building int m_gpuSSDNumTrees; int m_gpuSSDLeafSize; diff --git a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h index 50823168d..c1b268c9b 100644 --- a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h +++ b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h @@ -125,6 +125,12 @@ DefineSSDParameter(m_versionCacheTTLMs, int, 0, "VersionCacheTTLMs") DefineSSDParameter(m_versionCacheMaxChunks, int, 10000, "VersionCacheMaxChunks") DefineSSDParameter(m_asyncRpcMaxInflight, int, 0, "AsyncRpcMaxInflight") +// Distributed RemotePostingOps RPC tuning +DefineSSDParameter(m_remoteAppendChunkSize, int, 3000, "RemoteAppendChunkSize") +DefineSSDParameter(m_remoteAppendRetry, int, 3, "RemoteAppendRetry") +DefineSSDParameter(m_remoteAppendTimeoutSec, int, 180, "RemoteAppendTimeoutSec") +DefineSSDParameter(m_remoteAppendMaxInflight, int, 4, "RemoteAppendMaxInflight") + // GPU Building DefineSSDParameter(m_gpuSSDNumTrees, int, 100, "GPUSSDNumTrees") DefineSSDParameter(m_gpuSSDLeafSize, int, 200, "GPUSSDLeafSize") From 9619b2fda2134bcb5c9718833fc5422fde1763c8 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:23:27 +0000 Subject: [PATCH 16/51] Async Split/Merge jobs: retry counter + re-enqueue on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Design says async Split/MergeAsync jobs must be safe-to-retry from any compute node (Section: Async Job Fault Tolerance). Previous code recorded a non-Success ret into m_asyncStatus and silently dropped the job — a transient failure (TiKV blip, remote-lock timeout, etc.) permanently lost the split/merge. Both MergeAsyncJob and SplitAsyncJob now carry an attempts counter. On non-Success, if attempts+1 < m_asyncJobMaxRetry (new SPANN option, default 3), the job re-adds itself to m_splitThreadPool without touching the in-flight counter, so the outer drain loop still accounts for it. After MaxRetry exhaustion the failure surfaces via m_asyncStatus as before, plus a clear LL_Error log identifying the head and attempt count. Idempotency requirements for safe retry are already in place: - Owner check (IsRemoteOwnedHead) drops remote heads immediately - ContainSample liveness gate inside Split/MergePostings - Re-locking the per-head RWLock on each entry - Read-deduplicate during the next split attempt for partial writes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 43 ++++++++++++++++++- AnnService/inc/Core/SPANN/Options.h | 5 +++ .../inc/Core/SPANN/ParameterDefinitionList.h | 1 + 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 36d49bbfa..4044afad7 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -63,6 +63,7 @@ namespace SPTAG::SPANN { ExtraDynamicSearcher* m_extraIndex; SizeType m_headID; std::function m_callback; + int m_attempts = 0; public: MergeAsyncJob(ExtraDynamicSearcher* extraIndex, SizeType headID, std::function p_callback) : m_extraIndex(extraIndex), m_headID(headID), m_callback(std::move(p_callback)) {} @@ -73,8 +74,28 @@ namespace SPTAG::SPANN { } inline void exec(void* p_workSpace, IAbortOperation* p_abort) override { ErrorCode ret = m_extraIndex->MergePostings((ExtraWorkSpace*)p_workSpace, m_headID); - if (ret != ErrorCode::Success) + if (ret != ErrorCode::Success) { + int maxRetry = m_extraIndex->m_opt + ? m_extraIndex->m_opt->m_asyncJobMaxRetry : 0; + if (m_attempts + 1 < maxRetry) { + // Async-job fault-tolerance contract: merges are + // safe to retry idempotently (the owner check, the + // ContainSample liveness gate, and the locked RMW + // all re-evaluate on each attempt). Re-enqueue + // without touching m_mergeJobsInFlight so the + // outer "wait for in-flight" loop still sees us. + ++m_attempts; + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergeAsyncJob: head=%lld attempt=%d failed ret=%d, re-enqueueing\n", + (std::int64_t)m_headID, m_attempts, (int)ret); + m_extraIndex->m_splitThreadPool->add(this); + return; // skip cleanup; Job lives on + } m_extraIndex->m_asyncStatus = ret; + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "MergeAsyncJob: head=%lld giving up after %d attempts ret=%d\n", + (std::int64_t)m_headID, m_attempts + 1, (int)ret); + } m_extraIndex->m_mergeJobsInFlight--; m_extraIndex->m_totalMergeCompleted++; if (m_callback != nullptr) { @@ -89,6 +110,7 @@ namespace SPTAG::SPANN { ExtraDynamicSearcher* m_extraIndex; SizeType m_headID; std::function m_callback; + int m_attempts = 0; public: SplitAsyncJob(ExtraDynamicSearcher* extraIndex, SizeType headID, std::function p_callback) : m_extraIndex(extraIndex), m_headID(headID), m_callback(std::move(p_callback)) {} @@ -105,8 +127,25 @@ namespace SPTAG::SPANN { m_extraIndex->m_totalSplitTimeUs += elapsedUs; uint64_t prevMax = m_extraIndex->m_maxSplitTimeUs.load(); while (elapsedUs > prevMax && !m_extraIndex->m_maxSplitTimeUs.compare_exchange_weak(prevMax, elapsedUs)); - if (ret != ErrorCode::Success) + if (ret != ErrorCode::Success) { + int maxRetry = m_extraIndex->m_opt + ? m_extraIndex->m_opt->m_asyncJobMaxRetry : 0; + if (m_attempts + 1 < maxRetry) { + // See MergeAsyncJob: splits are designed safe to + // retry from any compute node (read-deduplicate + // during the next attempt handles partial writes). + ++m_attempts; + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "SplitAsyncJob: head=%lld attempt=%d failed ret=%d, re-enqueueing\n", + (std::int64_t)m_headID, m_attempts, (int)ret); + m_extraIndex->m_splitThreadPool->add(this); + return; + } m_extraIndex->m_asyncStatus = ret; + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "SplitAsyncJob: head=%lld giving up after %d attempts ret=%d\n", + (std::int64_t)m_headID, m_attempts + 1, (int)ret); + } m_extraIndex->m_splitJobsInFlight--; m_extraIndex->m_totalSplitCompleted++; if (m_callback != nullptr) { diff --git a/AnnService/inc/Core/SPANN/Options.h b/AnnService/inc/Core/SPANN/Options.h index 0bbe4a90a..6542069c9 100644 --- a/AnnService/inc/Core/SPANN/Options.h +++ b/AnnService/inc/Core/SPANN/Options.h @@ -133,6 +133,11 @@ namespace SPTAG { int m_remoteAppendTimeoutSec; int m_remoteAppendMaxInflight; + // Async Split/Merge job retry count. Distributed design + // requires async jobs to be safe-to-retry — see Async Job + // Fault Tolerance section. + int m_asyncJobMaxRetry; + // GPU building int m_gpuSSDNumTrees; int m_gpuSSDLeafSize; diff --git a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h index c1b268c9b..481947ca1 100644 --- a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h +++ b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h @@ -130,6 +130,7 @@ DefineSSDParameter(m_remoteAppendChunkSize, int, 3000, "RemoteAppendChunkSize") DefineSSDParameter(m_remoteAppendRetry, int, 3, "RemoteAppendRetry") DefineSSDParameter(m_remoteAppendTimeoutSec, int, 180, "RemoteAppendTimeoutSec") DefineSSDParameter(m_remoteAppendMaxInflight, int, 4, "RemoteAppendMaxInflight") +DefineSSDParameter(m_asyncJobMaxRetry, int, 3, "AsyncJobMaxRetry") // GPU Building DefineSSDParameter(m_gpuSSDNumTrees, int, 100, "GPUSSDNumTrees") From 864e2688a8fdddc94b985b673bc2bd9c0a514434 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:36:27 +0000 Subject: [PATCH 17/51] DispatchResult: carry SPTAG::ErrorCode back to driver Previously the dispatch result only signalled Success/Failed via a 1-byte enum, so any worker-side failure (TiKV unavailable, KeyNotFound during search, append rejection, etc.) collapsed into a generic 'Failed' that the driver couldn't distinguish or react to differently. Bump DispatchResult MirrorVersion 1 -> 2 and add m_errorCode (int32). Read/Write gated on mirror >= 2 so older peers stay compatible (they leave the field at 0). Driver-side HandleDispatchResult now logs the errorCode at LL_Error on failed paths, and the existing log line for every result echoes the code so post-mortem traces show exactly what each worker reported. Sample wiring: SPFreshTest's worker dispatch callback sets m_errorCode on its Unknown-command fallback. Other code paths (Search/Insert) already only fail through exceptions in the helpers, which the driver treats as crash-class events; the field is ready for future failure propagation work in those paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/DispatchCoordinator.h | 9 +++++++-- .../Core/SPANN/Distributed/DistributedProtocol.h | 15 +++++++++++++-- Test/src/SPFreshTest.cpp | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h b/AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h index 8bb32a7eb..ffd02f05c 100644 --- a/AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h +++ b/AnnService/inc/Core/SPANN/Distributed/DispatchCoordinator.h @@ -306,9 +306,10 @@ namespace SPTAG::SPANN { } SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "DispatchCoordinator: Result id=%llu round=%u node=%d status=%d wallTime=%.3f\n", + "DispatchCoordinator: Result id=%llu round=%u node=%d status=%d errorCode=%d wallTime=%.3f\n", (unsigned long long)result.m_dispatchId, result.m_round, - result.m_nodeIndex, (int)result.m_status, result.m_wallTime); + result.m_nodeIndex, (int)result.m_status, (int)result.m_errorCode, + result.m_wallTime); std::shared_ptr state; { @@ -325,6 +326,10 @@ namespace SPTAG::SPANN { if (result.m_status != DispatchResult::Status::Success) { state->errors++; + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "DispatchCoordinator: dispatch %llu node=%d failed errorCode=%d\n", + (unsigned long long)result.m_dispatchId, result.m_nodeIndex, + (int)result.m_errorCode); } { diff --git a/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h b/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h index b4da82fcc..963ca6b35 100644 --- a/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h +++ b/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h @@ -392,9 +392,11 @@ namespace SPTAG::SPANN { }; /// Result from worker back to driver after executing a dispatch command. + /// MirrorVersion 2 added m_errorCode so failures can carry SPTAG::ErrorCode + /// detail back to the driver instead of collapsing into a boolean. struct DispatchResult { static constexpr std::uint16_t MajorVersion() { return 1; } - static constexpr std::uint16_t MirrorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 2; } enum class Status : std::uint8_t { Success = 0, Failed = 1 }; Status m_status = Status::Success; @@ -402,11 +404,16 @@ namespace SPTAG::SPANN { std::uint32_t m_round = 0; double m_wallTime = 0.0; std::int32_t m_nodeIndex = -1; // which worker sent this result + // SPTAG::ErrorCode cast to int32 (Success == 0). Populated by the + // worker's dispatch callback so the driver can distinguish e.g. + // KeyNotFound from disk-full from network-fail. Older peers (mirror + // 1) leave this at 0 even when m_status == Failed. + std::int32_t m_errorCode = 0; std::size_t EstimateBufferSize() const { return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t) + sizeof(std::uint64_t) + sizeof(std::uint32_t) + sizeof(double) - + sizeof(std::int32_t); + + sizeof(std::int32_t) * 2; } std::uint8_t* Write(std::uint8_t* p_buffer) const { @@ -418,6 +425,7 @@ namespace SPTAG::SPANN { p_buffer = SimpleWriteBuffer(m_round, p_buffer); p_buffer = SimpleWriteBuffer(m_wallTime, p_buffer); p_buffer = SimpleWriteBuffer(m_nodeIndex, p_buffer); + p_buffer = SimpleWriteBuffer(m_errorCode, p_buffer); return p_buffer; } @@ -436,6 +444,9 @@ namespace SPTAG::SPANN { if (mirrorVer >= 1) { p_buffer = SimpleReadBuffer(p_buffer, m_nodeIndex); } + if (mirrorVer >= 2) { + p_buffer = SimpleReadBuffer(p_buffer, m_errorCode); + } return p_buffer; } }; diff --git a/Test/src/SPFreshTest.cpp b/Test/src/SPFreshTest.cpp index 5bef228a3..2c754635e 100644 --- a/Test/src/SPFreshTest.cpp +++ b/Test/src/SPFreshTest.cpp @@ -2941,6 +2941,7 @@ void RunWorker(const std::string& indexPath, int dimension, int baseVectorCount, SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Worker %d: Unknown command type %d\n", nodeIndex, (int)cmd.m_type); result.m_status = SPANN::DispatchResult::Status::Failed; + result.m_errorCode = static_cast(SPTAG::ErrorCode::Undefined); return result; }); From 1cd19f10a679b7c823accdb3697720b8c1552419 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:39:49 +0000 Subject: [PATCH 18/51] AppendCallback: HandleRaceCondition gate against in-flight split/merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Design's receive-side flow specifies a HandleRaceCondition step before the local Append callback runs: 'check whether the target HeadID is currently being split or merged on this node; if so, the append waits for the structural operation to commit before proceeding.' Without this, the existing wasMissing branch (which re-materializes a missing head from the sender's headVec) can resurrect a head that local Merge just deleted. The race is real but small — the per-head RWLock used by Append/Split/Merge already serializes RMW, but the head-index ContainSample check + AddHeadIndex resurrection happens outside that lock. Add ExtraDynamicSearcher::HandleRaceCondition(headID) that: 1. Peeks m_splitList / m_mergeList for the head. 2. If present, briefly acquires the per-head RWLock to wait for the structural op to commit. 3. Returns; the callback continues with a stable view, and the normal Append re-acquires the RWLock for the actual RMW. When the head is genuinely gone after the wait, the sender's later retry will see the updated head index (via HeadSync) and re-route to the new owner — exactly the path the design's Append-vs-Merge race section describes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 4044afad7..c97229af6 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -427,9 +427,41 @@ namespace SPTAG::SPANN { return m_initialVectorSize + (localVID - m_initialVectorSize) * numWorkers + GetWorkerNodeIndex(); } - // Idempotent: wires the receiver's BatchAppend Jobs onto our shared + // Receive-side race coordination: before applying a remote Append + // for headID, make sure no local Split or Merge is currently + // mutating the same head. Splits delete the original head and + // create new ones; merges delete a loser head. If we let the + // append's wasMissing branch run while a Split/Merge holds the + // RWLock, the AddHeadIndex resurrection would race the local + // DeleteIndex and we'd briefly bring a dead head back to life + // (only papered over by the eventual HeadSync from the structural + // op). Briefly acquiring the RWLock here serializes us behind + // the in-flight structural op without forking an explicit + // condition-variable channel. After the structural op completes + // its bookkeeping (lists drained, head index updated, HeadSync + // broadcast), the callback re-checks ContainSample with a stable + // view. When the head is genuinely gone, sender retries against + // the updated head index and routes to the new owner. + void HandleRaceCondition(SizeType headID) { + bool inSplit = false, inMerge = false; + { + std::shared_lock sl(m_splitListLock); + inSplit = (m_splitList.find(headID) != m_splitList.end()); + } + { + std::shared_lock sl(m_mergeListLock); + inMerge = (m_mergeList.find(headID) != m_mergeList.end()); + } + if (!inSplit && !inMerge) return; + // Wait until the structural op releases the per-head RWLock. + // Acquire-and-immediately-release; the Append below re-locks. + std::unique_lock w(m_rwLocks[headID]); + (void)w; + } + // SPDKThreadPool. Called both after pool creation and from // SetWorker(); whichever happens last actually binds the submitter. + // Idempotent: wires the receiver's BatchAppend Jobs onto our shared void WireJobSubmitterIfReady() { if (!m_worker || !m_splitThreadPool) return; auto pool = m_splitThreadPool; @@ -467,6 +499,13 @@ namespace SPTAG::SPANN { m_worker->SetAppendCallback(m_layer, [this](SizeType headID, std::shared_ptr headVec, int appendNum, std::string& appendPosting) -> ErrorCode { + // Per-design HandleRaceCondition: wait for any local + // Split/Merge on this head to commit before we look at + // the head index. Otherwise the wasMissing branch + // below can resurrect a head that the structural op + // just deleted. + HandleRaceCondition(headID); + // Reuse SPDKThreadPool's per-worker pre-allocated workspace // when called from BatchAppendItemJob on m_splitThreadPool. ExtraWorkSpace localWorkSpace; From dca197ba0c2ca580f57b01800ebe7953ccbead26 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:44:12 +0000 Subject: [PATCH 19/51] SPANN distributed: TTL-based remote lock lease MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the per-bucket atomic remote-lock cache with a dedicated RemoteLeaseTable that tracks per-bucket expiry timestamps. This lets the owner auto-reclaim a remote lock when the holder crashes or stalls beyond RemoteLockTtlMs (default 30s) instead of blocking Split/Merge forever. New file: AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h. Fencing tokens deferred — they require a protocol-mirror bump on RemoteLock{Request,Response} and a callback signature change; will be added when the watchdog/resend path lands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemoteLeaseTable.h | 109 ++++++++++++++++++ .../inc/Core/SPANN/ExtraDynamicSearcher.h | 31 ++--- AnnService/inc/Core/SPANN/Options.h | 6 + .../inc/Core/SPANN/ParameterDefinitionList.h | 1 + 4 files changed, 134 insertions(+), 13 deletions(-) create mode 100644 AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h diff --git a/AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h b/AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h new file mode 100644 index 000000000..2d6881c7e --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// RemoteLeaseTable +// ---------------- +// Owner-side bookkeeping for cross-node merge / structural-op locks. +// Backs the per-bucket advisory flag that local Split / Merge consult via +// WaitForRemoteBucketUnlocked before mutating a head whose ownership is +// shared with a remote candidate. +// +// Design contract (see Async Job Fault Tolerance): +// * Each acquired lock carries a bounded TTL. If the holder crashes or +// stops responding, the lease auto-expires and the owner is free to +// proceed (or grant the bucket to another holder). +// * No keepalive: structural ops are expected to complete in under one +// TTL. If they exceed the TTL, the holder must retry the whole job; +// the owner has already released the lease. +// +// The TTL is the single configurable knob (default 30s, matching the +// design's lease-TTL recommendation). A future iteration can add a +// fencing token so a zombie holder that resumes after expiry has its +// late unlock rejected — that requires a protocol bump on +// RemoteLockRequest/Response, which we'll do once a real owner-restart +// test exists to validate the change. For now the in-memory lease +// table provides the safety net the design requires: zombie holders +// never indefinitely block the owner. + +#ifndef _SPTAG_SPANN_DISTRIBUTED_REMOTELEASETABLE_H_ +#define _SPTAG_SPANN_DISTRIBUTED_REMOTELEASETABLE_H_ + +#include +#include +#include +#include + +namespace SPTAG::SPANN { + + class RemoteLeaseTable { + public: + using Clock = std::chrono::steady_clock; + + // bucketCount must match the searcher's lock-pool bucket count + // (FineGrainedRWLock::BucketIndex range). Allocates one slot per + // bucket; slots start in the unlocked state (expiry == 0). + explicit RemoteLeaseTable(std::size_t bucketCount, int ttlMs = 30000) + : m_count(bucketCount + 1), m_ttlMs(ttlMs) + { + m_expiry = std::make_unique[]>(m_count); + for (std::size_t i = 0; i < m_count; ++i) m_expiry[i].store(0, std::memory_order_relaxed); + } + + void SetTtlMs(int ttlMs) { if (ttlMs > 0) m_ttlMs.store(ttlMs, std::memory_order_relaxed); } + int GetTtlMs() const { return m_ttlMs.load(std::memory_order_relaxed); } + + // Try to grant a lease for bucket. Succeeds iff bucket is unlocked + // OR the previous holder's lease has expired (auto-reclamation). + // Records the new expiry deadline. + bool TryAcquire(unsigned bucket) { + if (bucket >= m_count) return false; + const std::int64_t nowNs = NowNs(); + const std::int64_t ttlNs = (std::int64_t)m_ttlMs.load(std::memory_order_relaxed) * 1'000'000LL; + std::int64_t current = m_expiry[bucket].load(std::memory_order_acquire); + for (;;) { + if (current != 0 && current > nowNs) return false; // still held by live lease + const std::int64_t newExpiry = nowNs + ttlNs; + if (m_expiry[bucket].compare_exchange_weak(current, newExpiry, + std::memory_order_acq_rel)) return true; + // CAS lost: re-evaluate with the updated `current`. + } + } + + // Release the lease unconditionally. In the current protocol the + // caller is trusted (holder cooperates). When a fencing token is + // added, this becomes a token-validated release. + void Release(unsigned bucket) { + if (bucket >= m_count) return; + m_expiry[bucket].store(0, std::memory_order_release); + } + + // True iff the lease is currently held AND not expired. Auto-clears + // expired entries so a stuck holder doesn't permanently block the + // owner's Split/Merge path. + bool IsLocked(unsigned bucket) { + if (bucket >= m_count) return false; + std::int64_t current = m_expiry[bucket].load(std::memory_order_acquire); + if (current == 0) return false; + if (current > NowNs()) return true; + // Expired: try to clear (best-effort; loss of race is OK because + // a concurrent holder either renewed or is also expired). + std::int64_t expected = current; + m_expiry[bucket].compare_exchange_strong(expected, 0, + std::memory_order_acq_rel); + return false; + } + + private: + static std::int64_t NowNs() { + return std::chrono::duration_cast( + Clock::now().time_since_epoch()).count(); + } + + std::size_t m_count; + std::atomic m_ttlMs; + std::unique_ptr[]> m_expiry; + }; + +} // namespace SPTAG::SPANN + +#endif // _SPTAG_SPANN_DISTRIBUTED_REMOTELEASETABLE_H_ diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index c97229af6..a97369d08 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -20,6 +20,7 @@ #include "inc/Core/Common/TiKVVersionMap.h" #include "ExtraFileController.h" #include "Distributed/WorkerNode.h" +#include "Distributed/RemoteLeaseTable.h" #include #include #include @@ -266,9 +267,11 @@ namespace SPTAG::SPANN { COMMON::FineGrainedRWLock m_rwLocks; - // Per-bucket flags for remote (cross-node) locking. + // Per-bucket lease table for remote (cross-node) locking. Each + // entry carries a TTL so a crashed/disconnected holder doesn't + // permanently block Split/Merge here. See RemoteLeaseTable.h. static constexpr int kRemoteLockPoolSize = 32767; - std::unique_ptr[]> m_remoteBucketLocked; + std::unique_ptr m_remoteLeaseTable; IndexStats m_stat; @@ -394,8 +397,11 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "[CONFIG] layer=%d DistributedVersionMap=%s SearchCheckVersionMapOnlyLayer0=%s UseMultiChunkPosting=%s PostingPageLimit=%d\n", layer, p_opt.m_distributedVersionMap ? "true" : "false", p_opt.m_searchCheckVersionMapOnlyLayer0 ? "true" : "false", p_opt.m_useMultiChunkPosting ? "true" : "false", p_opt.m_postingPageLimit); - // Initialize per-bucket remote lock flags - m_remoteBucketLocked.reset(new std::atomic[kRemoteLockPoolSize + 1]{}); + // Initialize per-bucket remote lease table. TTL is picked up + // from SPANN option RemoteLockTtlMs (default 30000ms = 30s). + m_remoteLeaseTable = std::make_unique( + kRemoteLockPoolSize, + p_opt.m_remoteLockTtlMs > 0 ? p_opt.m_remoteLockTtlMs : 30000); } ~ExtraDynamicSearcher() { @@ -570,22 +576,19 @@ namespace SPTAG::SPANN { } }); - // Remote lock callback: per-bucket atomic flags + // Remote lock callback: per-bucket leases with TTL auto-release. m_worker->SetRemoteLockCallback(m_layer, [this](SizeType headID, bool lock) -> bool { unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex(static_cast(headID)); if (lock) { - bool expected = false; - if (!m_remoteBucketLocked[bucket].compare_exchange_strong(expected, true)) { - return false; - } + if (!m_remoteLeaseTable->TryAcquire(bucket)) return false; if (!m_rwLocks[headID].try_lock()) { - m_remoteBucketLocked[bucket].store(false); + m_remoteLeaseTable->Release(bucket); return false; } m_rwLocks[headID].unlock(); return true; } else { - m_remoteBucketLocked[bucket].store(false); + m_remoteLeaseTable->Release(bucket); return true; } }); @@ -600,14 +603,16 @@ namespace SPTAG::SPANN { } // Owner-side wait for any in-flight remote lock on this bucket. + // RemoteLeaseTable::IsLocked auto-clears expired leases, so a + // zombie holder beyond TTL doesn't stall Split/Merge here. void WaitForRemoteBucketUnlocked(SizeType headID) const { if (!m_worker || !m_worker->IsEnabled()) return; unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex(static_cast(headID)); - if (!m_remoteBucketLocked[bucket].load(std::memory_order_acquire)) return; + if (!m_remoteLeaseTable->IsLocked(bucket)) return; constexpr int kMaxRemoteBucketWaitMs = 5000; auto deadline = std::chrono::steady_clock::now() + std::chrono::milliseconds(kMaxRemoteBucketWaitMs); - while (m_remoteBucketLocked[bucket].load(std::memory_order_acquire)) { + while (m_remoteLeaseTable->IsLocked(bucket)) { if (std::chrono::steady_clock::now() > deadline) { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "WaitForRemoteBucketUnlocked: headID=%lld bucket=%u stuck for %d ms, proceeding\n", diff --git a/AnnService/inc/Core/SPANN/Options.h b/AnnService/inc/Core/SPANN/Options.h index 6542069c9..e8546c17f 100644 --- a/AnnService/inc/Core/SPANN/Options.h +++ b/AnnService/inc/Core/SPANN/Options.h @@ -138,6 +138,12 @@ namespace SPTAG { // Fault Tolerance section. int m_asyncJobMaxRetry; + // Remote lock lease TTL in milliseconds (default 30000). + // Bounds how long a crashed or disconnected holder can block + // the owner's Split/Merge path; the owner auto-reclaims the + // lease on expiry. Match this to your structural-op p99. + int m_remoteLockTtlMs; + // GPU building int m_gpuSSDNumTrees; int m_gpuSSDLeafSize; diff --git a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h index 481947ca1..700a5d592 100644 --- a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h +++ b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h @@ -131,6 +131,7 @@ DefineSSDParameter(m_remoteAppendRetry, int, 3, "RemoteAppendRetry") DefineSSDParameter(m_remoteAppendTimeoutSec, int, 180, "RemoteAppendTimeoutSec") DefineSSDParameter(m_remoteAppendMaxInflight, int, 4, "RemoteAppendMaxInflight") DefineSSDParameter(m_asyncJobMaxRetry, int, 3, "AsyncJobMaxRetry") +DefineSSDParameter(m_remoteLockTtlMs, int, 30000, "RemoteLockTtlMs") // GPU Building DefineSSDParameter(m_gpuSSDNumTrees, int, 100, "GPUSSDNumTrees") From 489ff4ee043a0eec6b8b2dfc51fd75ccfb8a2aa7 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:47:24 +0000 Subject: [PATCH 20/51] SPANN distributed: watchdog for failed async append batches QueueRemoteAppend's auto-flush is fire-and-forget: when the receiver is briefly unreachable the batch was previously dropped after a single log line. This breaks the distributed design's at-least-once async job contract. Add AsyncJobWatchdog (new file under Distributed/) that owns timeout- driven, bounded exponential-backoff resends in a single background thread. Wire WorkerNode's auto-flush failure path to hand the batch to the watchdog instead of dropping it. RemoteAppend is idempotent on the receive side (per-posting RMW), so at-least-once is safe. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/AsyncJobWatchdog.h | 177 ++++++++++++++++++ .../inc/Core/SPANN/Distributed/WorkerNode.h | 28 ++- 2 files changed, 203 insertions(+), 2 deletions(-) create mode 100644 AnnService/inc/Core/SPANN/Distributed/AsyncJobWatchdog.h diff --git a/AnnService/inc/Core/SPANN/Distributed/AsyncJobWatchdog.h b/AnnService/inc/Core/SPANN/Distributed/AsyncJobWatchdog.h new file mode 100644 index 000000000..31bb8627f --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/AsyncJobWatchdog.h @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef _SPTAG_SPANN_DISTRIBUTED_ASYNCJOBWATCHDOG_H_ +#define _SPTAG_SPANN_DISTRIBUTED_ASYNCJOBWATCHDOG_H_ + +#include "inc/Helper/Logging.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace SPTAG { +namespace SPANN { +namespace Distributed { + +// AsyncJobWatchdog tracks async (fire-and-forget) inter-node dispatches +// and resends them on timeout or transport failure. +// +// Today the only fire-and-forget path is QueueRemoteAppend auto-flush in +// WorkerNode: it ships a batch of RemoteAppendRequests to a peer with no +// synchronous error propagation. Without a watchdog, transient network +// or peer-crash failures silently lose those appends. +// +// The watchdog is intentionally small: callers register a batch with a +// resend callback; the watchdog reschedules the callback up to +// MaxAttempts with exponential backoff. RemoteAppend is idempotent on +// the receive side (HandleRemoteAppend de-dups via per-posting RMW), so +// at-least-once delivery is safe. +class AsyncJobWatchdog { +public: + using ResendFn = std::function; // returns true on success + + AsyncJobWatchdog(int maxAttempts = 3, + int initialBackoffMs = 200) + : m_maxAttempts(maxAttempts), + m_initialBackoffMs(initialBackoffMs), + m_stop(false) { + m_worker = std::thread([this]() { Loop(); }); + } + + ~AsyncJobWatchdog() { + { + std::lock_guard lk(m_mutex); + m_stop = true; + } + m_cv.notify_all(); + if (m_worker.joinable()) m_worker.join(); + } + + // Submit a fire-and-forget dispatch. The watchdog calls `resend` if + // and only if a prior attempt has failed; the caller is responsible + // for the initial attempt. After success, call MarkSuccess(id). + uint64_t Track(ResendFn resend, std::string tag = "") { + std::lock_guard lk(m_mutex); + uint64_t id = ++m_nextId; + Entry e; + e.resend = std::move(resend); + e.attempts = 0; + e.tag = std::move(tag); + e.nextDeadline = std::chrono::steady_clock::time_point::max(); + m_entries.emplace(id, std::move(e)); + return id; + } + + void MarkSuccess(uint64_t id) { + std::lock_guard lk(m_mutex); + m_entries.erase(id); + } + + // Schedule a resend after backoff for entry `id`. Called by producer + // when its synchronous attempt fails. Gives up after MaxAttempts. + void MarkFailureAndScheduleResend(uint64_t id) { + std::unique_lock lk(m_mutex); + auto it = m_entries.find(id); + if (it == m_entries.end()) return; + if (++it->second.attempts >= m_maxAttempts) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "AsyncJobWatchdog: %s giving up after %d attempts\n", + it->second.tag.c_str(), it->second.attempts); + m_entries.erase(it); + return; + } + int backoffMs = m_initialBackoffMs << (it->second.attempts - 1); + it->second.nextDeadline = + std::chrono::steady_clock::now() + + std::chrono::milliseconds(backoffMs); + lk.unlock(); + m_cv.notify_all(); + } + + size_t OutstandingCount() const { + std::lock_guard lk(m_mutex); + return m_entries.size(); + } + +private: + struct Entry { + ResendFn resend; + int attempts; + std::string tag; + std::chrono::steady_clock::time_point nextDeadline; + }; + + void Loop() { + std::unique_lock lk(m_mutex); + while (!m_stop) { + auto now = std::chrono::steady_clock::now(); + auto nextWake = now + std::chrono::seconds(1); + std::vector due; + for (auto& kv : m_entries) { + if (kv.second.nextDeadline <= now) { + due.push_back(kv.first); + } else if (kv.second.nextDeadline < nextWake) { + nextWake = kv.second.nextDeadline; + } + } + for (uint64_t id : due) { + auto it = m_entries.find(id); + if (it == m_entries.end()) continue; + ResendFn fn = it->second.resend; + std::string tag = it->second.tag; + int attempt = it->second.attempts; + it->second.nextDeadline = + std::chrono::steady_clock::time_point::max(); + lk.unlock(); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "AsyncJobWatchdog: resending %s attempt=%d\n", + tag.c_str(), attempt + 1); + bool ok = false; + try { ok = fn(); } catch (...) { ok = false; } + lk.lock(); + if (ok) { + m_entries.erase(id); + } else { + auto it2 = m_entries.find(id); + if (it2 != m_entries.end()) { + if (++it2->second.attempts >= m_maxAttempts) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "AsyncJobWatchdog: %s giving up after %d attempts\n", + it2->second.tag.c_str(), it2->second.attempts); + m_entries.erase(it2); + } else { + int backoffMs = + m_initialBackoffMs << (it2->second.attempts - 1); + it2->second.nextDeadline = + std::chrono::steady_clock::now() + + std::chrono::milliseconds(backoffMs); + } + } + } + } + m_cv.wait_until(lk, nextWake, [this]() { return m_stop; }); + } + } + + mutable std::mutex m_mutex; + std::condition_variable m_cv; + std::unordered_map m_entries; + uint64_t m_nextId = 0; + int m_maxAttempts; + int m_initialBackoffMs; + bool m_stop; + std::thread m_worker; +}; + +} // namespace Distributed +} // namespace SPANN +} // namespace SPTAG + +#endif // _SPTAG_SPANN_DISTRIBUTED_ASYNCJOBWATCHDOG_H_ diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index d50edcfd5..40d537379 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -5,6 +5,7 @@ #define _SPTAG_SPANN_WORKERNODE_H_ #include "inc/Core/SPANN/Distributed/NetworkNode.h" +#include "inc/Core/SPANN/Distributed/AsyncJobWatchdog.h" #include "inc/Helper/KeyValueIO.h" #include "inc/Helper/CommonHelper.h" #include "inc/Socket/SimpleSerialization.h" @@ -279,8 +280,25 @@ namespace SPTAG::SPANN { while (true) { ErrorCode ret = SendBatchRemoteAppend(nodeIndex, *items); if (ret != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "QueueRemoteAppend auto-flush: batch to node %d failed (%zu items)\n", + // Hand the failed batch to the watchdog. It owns + // backoff/retry until MaxAttempts; RemoteAppend is + // idempotent on the receive side so at-least-once + // delivery is safe. + auto retryItems = + std::make_shared>(*items); + int n = nodeIndex; + auto self = this; + std::string tag = "QueueRemoteAppend node=" + + std::to_string(n) + " items=" + + std::to_string(retryItems->size()); + uint64_t id = m_asyncWatchdog.Track( + [self, n, retryItems]() { + return self->SendBatchRemoteAppend(n, *retryItems) + == ErrorCode::Success; + }, std::move(tag)); + m_asyncWatchdog.MarkFailureAndScheduleResend(id); + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "QueueRemoteAppend auto-flush: batch to node %d failed (%zu items), handed to watchdog\n", nodeIndex, items->size()); } items->clear(); @@ -598,6 +616,12 @@ namespace SPTAG::SPANN { static constexpr size_t kAutoFlushThreshold = 50000; std::atomic m_maxInflightPerNode{4}; + // Resends failed async fire-and-forget batches with exponential + // backoff (see AsyncJobWatchdog.h). Constructed last so it tears + // down before the queues; declared here so destruction order + // matches the design's fault-tolerance contract. + Distributed::AsyncJobWatchdog m_asyncWatchdog{3, 200}; + std::mutex& GetPerNodeAppendFlushMutex(int nodeIndex) { std::lock_guard lk(m_perNodeAppendFlushMutexMapLock); auto it = m_perNodeAppendFlushMutex.find(nodeIndex); From 7093d4060f0221a55d9a413fb051b4b579d3bf34 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 09:52:13 +0000 Subject: [PATCH 21/51] SPANN distributed: durable HeadSync log + Split WAL scaffolding Adds two TiKV-backed durability primitives matching the distributed design's HeadSync Job Fault Tolerance and Split Path WAL sections: * HeadSyncLog (new file Distributed/HeadSyncLog.h) Per-shard monotonically-versioned log of HeadSyncEntry, keyed by 'hs/e//', with 'hs/v/' as the published tip and 'hs/c//' as each node's applied cursor. Exposes Append/ReadSince/LoadCursor/StoreCursor and an optional background reconciler thread. Raw KV (no txn) per design guidance; producer-side per-shard mutex serializes version bumps and the next reader catches up via cursor replay. * SplitWAL (new file Distributed/SplitWAL.h) Stage-tracked record under 'wal/split//' so that a cross-owner split can be GC'd after partial failure (one side written, the other not). Wire-in: ExtraDynamicSearcher's BroadcastHeadSync now persists entries to HeadSyncLog before issuing the in-memory broadcast. Broadcast remains the latency path; TiKV is the source of truth so lost or duplicated broadcasts no longer threaten correctness. SplitWAL Begin/Commit hooks at the split site, and reconciler thread activation, are scaffolded behind the new members but not yet wired into the split flow; they are sequential follow-ups that require distributed integration testing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/Distributed/HeadSyncLog.h | 282 ++++++++++++++++++ .../inc/Core/SPANN/Distributed/SplitWAL.h | 105 +++++++ .../inc/Core/SPANN/ExtraDynamicSearcher.h | 29 ++ 3 files changed, 416 insertions(+) create mode 100644 AnnService/inc/Core/SPANN/Distributed/HeadSyncLog.h create mode 100644 AnnService/inc/Core/SPANN/Distributed/SplitWAL.h diff --git a/AnnService/inc/Core/SPANN/Distributed/HeadSyncLog.h b/AnnService/inc/Core/SPANN/Distributed/HeadSyncLog.h new file mode 100644 index 000000000..eb71f666e --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/HeadSyncLog.h @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef _SPTAG_SPANN_DISTRIBUTED_HEADSYNCLOG_H_ +#define _SPTAG_SPANN_DISTRIBUTED_HEADSYNCLOG_H_ + +#include "inc/Core/Common.h" +#include "inc/Helper/KeyValueIO.h" +#include "inc/Helper/Logging.h" +#include "inc/Core/SPANN/Distributed/DistributedProtocol.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace SPTAG { +namespace SPANN { +namespace Distributed { + +// HeadSyncLog: durable per-shard log of HeadSync entries in TiKV. +// +// Per the distributed design, the canonical source of truth for head +// topology changes is TiKV, not the in-memory broadcast. Each shard +// (today: per owner node) holds: +// * `hs/v/` little-endian uint64 latest version +// * `hs/e//` serialized HeadSyncEntry payload +// * `hs/c//` little-endian uint64 applied version +// +// Versions are monotonically increasing per shard. Producers serialize +// their version-bump under `m_appendMutex` and write entry-then-version; +// readers tolerate a transient lag where version points slightly past +// the last entry (treat the missing entry as not-yet-visible and retry). +// TiKV's raw KV API gives no multi-key atomicity; the design (per user +// direction) accepts this and relies on idempotent apply + cursor +// catch-up to converge. +// +// This header is intentionally self-contained; it does not depend on +// any SPANN searcher type. ExtraDynamicSearcher wires it up by +// constructing one instance per layer-0 ExtraDynamicSearcher, calling +// Append() in BroadcastHeadSync, and supplying an ApplyFn callback for +// the reconciler. +class HeadSyncLog { +public: + // Decoded entry returned by ReadSince. Carries the version so the + // reconciler can advance its cursor strictly past it on success. + struct VersionedEntry { + std::uint64_t version; + HeadSyncEntry entry; + }; + + using ApplyFn = std::function; + + HeadSyncLog(std::shared_ptr db, + int nodeIndex, + int reconcileIntervalMs = 2000) + : m_db(std::move(db)), + m_nodeIndex(nodeIndex), + m_reconcileIntervalMs(reconcileIntervalMs), + m_stop(false) {} + + ~HeadSyncLog() { Stop(); } + + // Append a batch of entries to the given shard's log. Returns the + // version of the last written entry (>= 1 on success, 0 on failure). + std::uint64_t Append(int shard, const std::vector& entries) { + if (!m_db || entries.empty()) return 0; + std::lock_guard lk(GetShardAppendMutex(shard)); + std::uint64_t base = LoadLatestVersion(shard); + std::vector keys; + std::vector values; + keys.reserve(entries.size()); + values.reserve(entries.size()); + std::uint64_t v = base; + for (const auto& e : entries) { + ++v; + keys.push_back(MakeEntryKey(shard, v)); + values.push_back(EncodeEntry(e)); + } + auto ec = m_db->MultiPut(keys, values, kTimeout, nullptr); + if (ec != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "HeadSyncLog::Append shard=%d entries=%zu MultiPut failed (%d)\n", + shard, entries.size(), (int)ec); + return 0; + } + ec = m_db->Put(MakeVersionKey(shard), + EncodeUint64(v), + kTimeout, nullptr); + if (ec != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "HeadSyncLog::Append shard=%d version Put failed (%d), entries durable but version lag\n", + shard, (int)ec); + // Entries are durable; the next Append (or reconciler in + // another node) will discover them via probe. + return v; + } + return v; + } + + // Read latest version that the shard publisher has advanced to. + // Returns 0 if no version is published yet or on read failure. + std::uint64_t GetLatestVersion(int shard) const { return LoadLatestVersion(shard); } + + // Read entries (cursor, latest], one at a time. Stops at the first + // missing version (which indicates writer lag). + std::vector ReadSince(int shard, + std::uint64_t cursor, + std::uint64_t latest, + size_t maxBatch = 256) const { + std::vector out; + if (!m_db || cursor >= latest) return out; + size_t want = std::min(maxBatch, + static_cast(latest - cursor)); + std::vector keys; + keys.reserve(want); + for (size_t i = 0; i < want; ++i) { + keys.push_back(MakeEntryKey(shard, cursor + 1 + i)); + } + std::vector values; + auto ec = m_db->MultiGet(keys, &values, kTimeout, nullptr); + if (ec != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "HeadSyncLog::ReadSince shard=%d MultiGet failed (%d)\n", + shard, (int)ec); + return out; + } + for (size_t i = 0; i < values.size(); ++i) { + if (values[i].empty()) break; // writer lag; stop here + VersionedEntry ve; + ve.version = cursor + 1 + i; + if (!DecodeEntry(values[i], ve.entry)) break; + out.push_back(std::move(ve)); + } + return out; + } + + // Cursor I/O for a (node, shard) pair. + std::uint64_t LoadCursor(int shard) const { + if (!m_db) return 0; + std::string out; + auto ec = m_db->Get(MakeCursorKey(m_nodeIndex, shard), &out, kTimeout, nullptr); + if (ec != ErrorCode::Success || out.size() < sizeof(std::uint64_t)) return 0; + return DecodeUint64(out); + } + + bool StoreCursor(int shard, std::uint64_t version) { + if (!m_db) return false; + auto ec = m_db->Put(MakeCursorKey(m_nodeIndex, shard), + EncodeUint64(version), + kTimeout, nullptr); + return ec == ErrorCode::Success; + } + + // Start a background reconciler that wakes every interval and, for + // each known shard, fetches missing entries since the local cursor + // and feeds them to `apply`. `apply` must be idempotent. + void StartReconciler(std::vector shards, ApplyFn apply) { + if (m_reconciler.joinable()) return; + m_shards = std::move(shards); + m_apply = std::move(apply); + m_stop = false; + m_reconciler = std::thread([this]() { ReconcileLoop(); }); + } + + void Stop() { + { + std::lock_guard lk(m_cvMutex); + m_stop = true; + } + m_cv.notify_all(); + if (m_reconciler.joinable()) m_reconciler.join(); + } + +private: + static constexpr auto kTimeout = std::chrono::microseconds(2'000'000); + + static std::string EncodeUint64(std::uint64_t v) { + std::string s(sizeof(v), '\0'); + memcpy(&s[0], &v, sizeof(v)); + return s; + } + static std::uint64_t DecodeUint64(const std::string& s) { + std::uint64_t v = 0; + if (s.size() >= sizeof(v)) memcpy(&v, s.data(), sizeof(v)); + return v; + } + static std::string MakeVersionKey(int shard) { + return "hs/v/" + std::to_string(shard); + } + static std::string MakeEntryKey(int shard, std::uint64_t version) { + // Big-endian version so byte-range scans (if added later) are + // monotonically sorted. + std::string s = "hs/e/" + std::to_string(shard) + "/"; + char be[8]; + for (int i = 0; i < 8; ++i) be[i] = static_cast((version >> ((7 - i) * 8)) & 0xff); + s.append(be, 8); + return s; + } + static std::string MakeCursorKey(int node, int shard) { + return "hs/c/" + std::to_string(node) + "/" + std::to_string(shard); + } + + static std::string EncodeEntry(const HeadSyncEntry& e) { + std::string s(e.EstimateBufferSize(), '\0'); + std::uint8_t* end = e.Write(reinterpret_cast(&s[0])); + s.resize(static_cast(end - reinterpret_cast(&s[0]))); + return s; + } + static bool DecodeEntry(const std::string& s, HeadSyncEntry& e) { + if (s.empty()) return false; + e.Read(reinterpret_cast(s.data())); + return true; + } + + std::uint64_t LoadLatestVersion(int shard) const { + std::string out; + auto ec = m_db->Get(MakeVersionKey(shard), &out, kTimeout, nullptr); + if (ec != ErrorCode::Success) return 0; + return DecodeUint64(out); + } + + std::mutex& GetShardAppendMutex(int shard) { + std::lock_guard lk(m_appendMutexMapLock); + auto& slot = m_appendMutexes[shard]; + if (!slot) slot = std::make_unique(); + return *slot; + } + + void ReconcileLoop() { + std::unique_lock lk(m_cvMutex); + while (!m_stop) { + lk.unlock(); + for (int shard : m_shards) { + std::uint64_t cursor = LoadCursor(shard); + std::uint64_t latest = LoadLatestVersion(shard); + if (latest <= cursor) continue; + auto entries = ReadSince(shard, cursor, latest); + if (entries.empty()) continue; + std::uint64_t advanced = cursor; + for (const auto& ve : entries) { + if (!m_apply(ve)) break; + advanced = ve.version; + } + if (advanced > cursor) { + StoreCursor(shard, advanced); + } + } + lk.lock(); + m_cv.wait_for(lk, std::chrono::milliseconds(m_reconcileIntervalMs), + [this]() { return m_stop; }); + } + } + + std::shared_ptr m_db; + int m_nodeIndex; + int m_reconcileIntervalMs; + + std::mutex m_appendMutexMapLock; + std::unordered_map> m_appendMutexes; + + std::vector m_shards; + ApplyFn m_apply; + + mutable std::mutex m_cvMutex; + std::condition_variable m_cv; + bool m_stop; + std::thread m_reconciler; +}; + +} // namespace Distributed +} // namespace SPANN +} // namespace SPTAG + +#endif // _SPTAG_SPANN_DISTRIBUTED_HEADSYNCLOG_H_ diff --git a/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h b/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h new file mode 100644 index 000000000..1bc84b052 --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef _SPTAG_SPANN_DISTRIBUTED_SPLITWAL_H_ +#define _SPTAG_SPANN_DISTRIBUTED_SPLITWAL_H_ + +#include "inc/Core/Common.h" +#include "inc/Helper/KeyValueIO.h" +#include "inc/Helper/Logging.h" + +#include +#include +#include +#include +#include + +namespace SPTAG { +namespace SPANN { +namespace Distributed { + +// SplitWAL: durable write-ahead log entry for a cross-owner split. +// +// Per the distributed design's Split Happy Path, when a split produces +// two child heads owned by different nodes, the split writes the local +// child via PutPostingToDB and the remote child via the remote queue. +// If either write fails after the other succeeded, a WAL-driven GC job +// must clean up the orphan posting under the partner head. +// +// Key schema: +// wal/split// → encoded SplitWALRecord +// Garbage-collection (background): scan `wal/split/` prefix; if a +// record is older than `kStaleSec` and not marked committed, it +// represents either an in-flight split or a crashed one — issue +// best-effort deletes against both children using the recorded headIDs. +// +// Today this is scaffolding: Begin/Commit hooks should wrap the split's +// cross-owner write path in ExtraDynamicSearcher. GC sweep can run on +// the existing RefineIndex cadence. +class SplitWAL { +public: + enum class Stage : std::uint8_t { + Begin = 0, // both children allocated, neither written + LocalDone = 1, // local write succeeded; remote pending + RemoteDone = 2, // remote write succeeded; local pending + BothDone = 3, // both written; safe to remove WAL + delete src + }; + + struct Record { + std::uint64_t jobID; + SizeType srcHeadID; + SizeType localChildHeadID; + SizeType remoteChildHeadID; + int remoteOwnerNodeIndex; + std::int64_t startTimestampSec; + Stage stage; + + std::string Encode() const { + std::string s(sizeof(Record), '\0'); + memcpy(&s[0], this, sizeof(Record)); + return s; + } + bool Decode(const std::string& s) { + if (s.size() < sizeof(Record)) return false; + memcpy(this, s.data(), sizeof(Record)); + return true; + } + }; + + explicit SplitWAL(std::shared_ptr db) : m_db(std::move(db)) {} + + // Write or update a WAL record. Stage transitions are monotonic. + bool Write(const Record& r) { + if (!m_db) return false; + auto ec = m_db->Put(MakeKey(r.srcHeadID, r.jobID), r.Encode(), kTimeout, nullptr); + if (ec != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "SplitWAL::Write head=%lld job=%llu stage=%u failed (%d)\n", + (long long)r.srcHeadID, (unsigned long long)r.jobID, + (unsigned)r.stage, (int)ec); + return false; + } + return true; + } + + // Remove a completed WAL record after both writes succeeded. + bool Clear(SizeType srcHeadID, std::uint64_t jobID) { + if (!m_db) return false; + std::vector k{ MakeKey(srcHeadID, jobID) }; + return m_db->MultiDelete(k, kTimeout) == ErrorCode::Success; + } + + static std::string MakeKey(SizeType srcHeadID, std::uint64_t jobID) { + return "wal/split/" + std::to_string(srcHeadID) + "/" + std::to_string(jobID); + } + +private: + static constexpr auto kTimeout = std::chrono::microseconds(2'000'000); + std::shared_ptr m_db; +}; + +} // namespace Distributed +} // namespace SPANN +} // namespace SPTAG + +#endif // _SPTAG_SPANN_DISTRIBUTED_SPLITWAL_H_ diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index a97369d08..6e7f35eb3 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -21,6 +21,8 @@ #include "ExtraFileController.h" #include "Distributed/WorkerNode.h" #include "Distributed/RemoteLeaseTable.h" +#include "Distributed/HeadSyncLog.h" +#include "Distributed/SplitWAL.h" #include #include #include @@ -273,6 +275,13 @@ namespace SPTAG::SPANN { static constexpr int kRemoteLockPoolSize = 32767; std::unique_ptr m_remoteLeaseTable; + // Durable HeadSync log + per-owner split WAL. Populated by + // SetWorker once we have the shared TiKV handle. See + // Distributed/HeadSyncLog.h and Distributed/SplitWAL.h. + std::unique_ptr m_headSyncLog; + std::unique_ptr m_splitWAL; + std::atomic m_splitJobIdCounter{ 0 }; + IndexStats m_stat; std::shared_ptr m_wal; @@ -494,6 +503,17 @@ namespace SPTAG::SPANN { m_worker->SetRpcMaxInflightPerNode(m_opt->m_remoteAppendMaxInflight); } + // Initialize durable HeadSync log + SplitWAL once we know the + // worker (and therefore the node identity). Both are layer-0 + // concerns: only layer 0 actually broadcasts HeadSync and + // performs cross-owner splits. See Distributed/HeadSyncLog.h + // and Distributed/SplitWAL.h. + if (m_layer == 0 && db) { + m_headSyncLog = std::make_unique( + db, m_worker->GetWorkerNodeIndex()); + m_splitWAL = std::make_unique(db); + } + WireJobSubmitterIfReady(); // Claim ownership so the matching destructor's IfOwner check @@ -1406,6 +1426,15 @@ namespace SPTAG::SPANN { headSyncEntries.push_back(std::move(entry)); } if (!headSyncEntries.empty()) { + // Durably persist to TiKV first, then broadcast. + // Per design, broadcast is a best-effort latency + // optimization; TiKV is the source of truth. + // Shard = owning node so each owner advances its + // own version counter independently. + if (m_headSyncLog) { + int shard = m_worker->GetWorkerNodeIndex(); + m_headSyncLog->Append(shard, headSyncEntries); + } m_worker->BroadcastHeadSync(headSyncEntries); } } From 111d37c555999d8f3ccd1a11e7d193c85944e1c1 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 11:07:16 +0000 Subject: [PATCH 22/51] SPANN distributed: full lease-fencing with monotonic fencing tokens Per the design's Async Job Fault Tolerance section, lease-based locks need an accompanying fencing token so that a zombie holder which resumes after its lease expired cannot mutate state now protected by a newer holder. Protocol bumps (backwards compatible via mirror-version gates): * RemoteAppendRequest mirror 1 -> 2: m_fencingToken (uint64). Token 0 = unfenced (normal owner-ring route). * RemoteLockRequest mirror 1 -> 2: m_token (uint64). Lock sends 0; Unlock sends issued token. * RemoteLockResponse mirror 0 -> 1: m_token (uint64). Owner returns issued fencing token on Lock. API changes: * RemoteLeaseTable: TryAcquire returns uint64_t token (0=denied); Release(bucket, token) only succeeds if token matches; Validate used by receiver-side fence check. * RemoteLockCallback: bool -> uint64_t signature carrying the token. * SendRemoteLock returns uint64_t (issued token on Lock). * New FenceValidator callback + RemotePostingOps fence-check on inbound RemoteAppend; rejected if token stale. * New WorkerNode::SendFencedRemoteAppend synchronous helper for split's cross-owner write path (unblocks split-atomicity). The ExtraDynamicSearcher lock callback now plumbs tokens end-to-end through RemoteLeaseTable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../SPANN/Distributed/DistributedProtocol.h | 42 ++++++- .../Core/SPANN/Distributed/RemoteLeaseTable.h | 93 ++++++++------- .../Core/SPANN/Distributed/RemotePostingOps.h | 107 ++++++++++++++++-- .../inc/Core/SPANN/Distributed/WorkerNode.h | 23 +++- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 34 ++++-- 5 files changed, 233 insertions(+), 66 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h b/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h index 963ca6b35..082bdb373 100644 --- a/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h +++ b/AnnService/inc/Core/SPANN/Distributed/DistributedProtocol.h @@ -15,15 +15,20 @@ namespace SPTAG::SPANN { /// Serializable request for remote Append operations sent between compute nodes. /// MirrorVersion 1 added m_layer to disambiguate which ExtraDynamicSearcher on /// the receiver side handles the request. Version 0 packets default m_layer=0. + /// MirrorVersion 2 added m_fencingToken: when nonzero the receiver must + /// validate the token against its RemoteLeaseTable for the head's bucket + /// before applying. Token 0 means "no fencing required" (used by the + /// normal owner-ring auto-route path that does not hold any remote lock). struct RemoteAppendRequest { static constexpr std::uint16_t MajorVersion() { return 1; } - static constexpr std::uint16_t MirrorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 2; } SizeType m_headID = 0; std::string m_headVec; // raw head vector bytes std::int32_t m_appendNum = 0; std::string m_appendPosting; // serialized posting data std::int32_t m_layer = 0; // originating ExtraDynamicSearcher layer + std::uint64_t m_fencingToken = 0; // 0 = unfenced (legacy path) std::size_t EstimateBufferSize() const { std::size_t size = 0; @@ -33,6 +38,7 @@ namespace SPTAG::SPANN { size += sizeof(std::int32_t); // appendNum size += sizeof(std::uint32_t) + m_appendPosting.size(); // appendPosting (len-prefixed) size += sizeof(std::int32_t); // layer (mirrorVer >= 1) + size += sizeof(std::uint64_t); // fencingToken (mirrorVer >= 2) return size; } @@ -45,6 +51,7 @@ namespace SPTAG::SPANN { p_buffer = SimpleWriteBuffer(m_appendNum, p_buffer); p_buffer = SimpleWriteBuffer(m_appendPosting, p_buffer); p_buffer = SimpleWriteBuffer(m_layer, p_buffer); + p_buffer = SimpleWriteBuffer(m_fencingToken, p_buffer); return p_buffer; } @@ -67,6 +74,11 @@ namespace SPTAG::SPANN { } else { m_layer = 0; } + if (mirrorVer >= 2) { + p_buffer = SafeSimpleReadBuffer(p_buffer, p_bufEnd, m_fencingToken); + } else { + m_fencingToken = 0; + } return p_buffer; } }; @@ -454,18 +466,22 @@ namespace SPTAG::SPANN { /// Request to lock/unlock a headID on its owner node (for cross-node Merge). /// MirrorVersion 1 added m_layer so multi-layer setups dispatch to the /// correct lock pool (each ExtraDynamicSearcher owns its own bucket flags). + /// MirrorVersion 2 added m_token for fencing: Lock requests send token=0; + /// Unlock requests send the token issued by the prior Lock so a zombie + /// holder whose lease expired cannot release a lock now held by someone else. struct RemoteLockRequest { static constexpr std::uint16_t MajorVersion() { return 1; } - static constexpr std::uint16_t MirrorVersion() { return 1; } + static constexpr std::uint16_t MirrorVersion() { return 2; } enum class Op : std::uint8_t { Lock = 0, Unlock = 1 }; Op m_op = Op::Lock; SizeType m_headID = 0; std::int32_t m_layer = 0; + std::uint64_t m_token = 0; std::size_t EstimateBufferSize() const { return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t) - + sizeof(SizeType) + sizeof(std::int32_t); + + sizeof(SizeType) + sizeof(std::int32_t) + sizeof(std::uint64_t); } std::uint8_t* Write(std::uint8_t* p_buffer) const { @@ -475,6 +491,7 @@ namespace SPTAG::SPANN { p_buffer = SimpleWriteBuffer(static_cast(m_op), p_buffer); p_buffer = SimpleWriteBuffer(m_headID, p_buffer); p_buffer = SimpleWriteBuffer(m_layer, p_buffer); + p_buffer = SimpleWriteBuffer(m_token, p_buffer); return p_buffer; } @@ -493,20 +510,29 @@ namespace SPTAG::SPANN { } else { m_layer = 0; } + if (mirrorVer >= 2) { + p_buffer = SimpleReadBuffer(p_buffer, m_token); + } else { + m_token = 0; + } return p_buffer; } }; /// Response for remote lock operations. + /// MirrorVersion 1 added m_token: the owner returns the issued fencing + /// token on a successful Lock so the holder can attach it to subsequent + /// lock-protected operations. Unlock responses return token=0. struct RemoteLockResponse { static constexpr std::uint16_t MajorVersion() { return 1; } - static constexpr std::uint16_t MirrorVersion() { return 0; } + static constexpr std::uint16_t MirrorVersion() { return 1; } enum class Status : std::uint8_t { Granted = 0, Denied = 1 }; Status m_status = Status::Granted; + std::uint64_t m_token = 0; std::size_t EstimateBufferSize() const { - return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t); + return sizeof(std::uint16_t) * 2 + sizeof(std::uint8_t) + sizeof(std::uint64_t); } std::uint8_t* Write(std::uint8_t* p_buffer) const { @@ -514,6 +540,7 @@ namespace SPTAG::SPANN { p_buffer = SimpleWriteBuffer(MajorVersion(), p_buffer); p_buffer = SimpleWriteBuffer(MirrorVersion(), p_buffer); p_buffer = SimpleWriteBuffer(static_cast(m_status), p_buffer); + p_buffer = SimpleWriteBuffer(m_token, p_buffer); return p_buffer; } @@ -526,6 +553,11 @@ namespace SPTAG::SPANN { std::uint8_t rawOp = 0; p_buffer = SimpleReadBuffer(p_buffer, rawOp); m_status = static_cast(rawOp); + if (mirrorVer >= 1) { + p_buffer = SimpleReadBuffer(p_buffer, m_token); + } else { + m_token = 0; + } return p_buffer; } }; diff --git a/AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h b/AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h index 2d6881c7e..ed95903fd 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemoteLeaseTable.h @@ -4,27 +4,18 @@ // RemoteLeaseTable // ---------------- // Owner-side bookkeeping for cross-node merge / structural-op locks. -// Backs the per-bucket advisory flag that local Split / Merge consult via -// WaitForRemoteBucketUnlocked before mutating a head whose ownership is -// shared with a remote candidate. +// Each bucket has a TTL-bounded lease AND a monotonically increasing +// fencing token so a zombie holder that resumes after lease expiry has +// its late operations rejected (see Async Job Fault Tolerance in the +// design doc). // -// Design contract (see Async Job Fault Tolerance): -// * Each acquired lock carries a bounded TTL. If the holder crashes or -// stops responding, the lease auto-expires and the owner is free to -// proceed (or grant the bucket to another holder). -// * No keepalive: structural ops are expected to complete in under one -// TTL. If they exceed the TTL, the holder must retry the whole job; -// the owner has already released the lease. +// API: +// TryAcquire(bucket) -> uint64_t token (0 = denied) +// Validate(bucket, token) -> bool, the held token still matches +// Release(bucket, token) -> bool, only releases if token matches +// IsLocked(bucket) -> bool, auto-clears expired entries // -// The TTL is the single configurable knob (default 30s, matching the -// design's lease-TTL recommendation). A future iteration can add a -// fencing token so a zombie holder that resumes after expiry has its -// late unlock rejected — that requires a protocol bump on -// RemoteLockRequest/Response, which we'll do once a real owner-restart -// test exists to validate the change. For now the in-memory lease -// table provides the safety net the design requires: zombie holders -// never indefinitely block the owner. - +// The TTL knob is `RemoteLockTtlMs` in SPANN options (default 30s). #ifndef _SPTAG_SPANN_DISTRIBUTED_REMOTELEASETABLE_H_ #define _SPTAG_SPANN_DISTRIBUTED_REMOTELEASETABLE_H_ @@ -39,57 +30,73 @@ namespace SPTAG::SPANN { public: using Clock = std::chrono::steady_clock; - // bucketCount must match the searcher's lock-pool bucket count - // (FineGrainedRWLock::BucketIndex range). Allocates one slot per - // bucket; slots start in the unlocked state (expiry == 0). explicit RemoteLeaseTable(std::size_t bucketCount, int ttlMs = 30000) : m_count(bucketCount + 1), m_ttlMs(ttlMs) { m_expiry = std::make_unique[]>(m_count); - for (std::size_t i = 0; i < m_count; ++i) m_expiry[i].store(0, std::memory_order_relaxed); + m_tokens = std::make_unique[]>(m_count); + for (std::size_t i = 0; i < m_count; ++i) { + m_expiry[i].store(0, std::memory_order_relaxed); + m_tokens[i].store(0, std::memory_order_relaxed); + } } void SetTtlMs(int ttlMs) { if (ttlMs > 0) m_ttlMs.store(ttlMs, std::memory_order_relaxed); } int GetTtlMs() const { return m_ttlMs.load(std::memory_order_relaxed); } - // Try to grant a lease for bucket. Succeeds iff bucket is unlocked + // Try to grant a lease for bucket. Succeeds iff bucket is unlocked // OR the previous holder's lease has expired (auto-reclamation). - // Records the new expiry deadline. - bool TryAcquire(unsigned bucket) { - if (bucket >= m_count) return false; + // Returns the fencing token (>= 1) on success, 0 on denial. + std::uint64_t TryAcquire(unsigned bucket) { + if (bucket >= m_count) return 0; const std::int64_t nowNs = NowNs(); const std::int64_t ttlNs = (std::int64_t)m_ttlMs.load(std::memory_order_relaxed) * 1'000'000LL; std::int64_t current = m_expiry[bucket].load(std::memory_order_acquire); for (;;) { - if (current != 0 && current > nowNs) return false; // still held by live lease + if (current != 0 && current > nowNs) return 0; // still held by live lease const std::int64_t newExpiry = nowNs + ttlNs; if (m_expiry[bucket].compare_exchange_weak(current, newExpiry, - std::memory_order_acq_rel)) return true; - // CAS lost: re-evaluate with the updated `current`. + std::memory_order_acq_rel)) { + std::uint64_t tok = m_nextToken.fetch_add(1, std::memory_order_acq_rel) + 1; + m_tokens[bucket].store(tok, std::memory_order_release); + return tok; + } } } - // Release the lease unconditionally. In the current protocol the - // caller is trusted (holder cooperates). When a fencing token is - // added, this becomes a token-validated release. - void Release(unsigned bucket) { - if (bucket >= m_count) return; + // True iff bucket currently holds `token` AND lease not expired. + bool Validate(unsigned bucket, std::uint64_t token) const { + if (bucket >= m_count || token == 0) return false; + std::int64_t exp = m_expiry[bucket].load(std::memory_order_acquire); + if (exp == 0 || exp <= NowNs()) return false; + return m_tokens[bucket].load(std::memory_order_acquire) == token; + } + + // Release the lease only if the caller's token still matches. + // Late unlocks from a zombie holder whose lease expired (and was + // reacquired by another holder) silently no-op. + bool Release(unsigned bucket, std::uint64_t token) { + if (bucket >= m_count) return false; + std::uint64_t held = m_tokens[bucket].load(std::memory_order_acquire); + if (token == 0 || held != token) return false; + // Clear token first so a concurrent Validate sees the release + // before the expiry window closes. + m_tokens[bucket].store(0, std::memory_order_release); m_expiry[bucket].store(0, std::memory_order_release); + return true; } - // True iff the lease is currently held AND not expired. Auto-clears - // expired entries so a stuck holder doesn't permanently block the - // owner's Split/Merge path. + // True iff the lease is currently held AND not expired. bool IsLocked(unsigned bucket) { if (bucket >= m_count) return false; std::int64_t current = m_expiry[bucket].load(std::memory_order_acquire); if (current == 0) return false; if (current > NowNs()) return true; - // Expired: try to clear (best-effort; loss of race is OK because - // a concurrent holder either renewed or is also expired). std::int64_t expected = current; - m_expiry[bucket].compare_exchange_strong(expected, 0, - std::memory_order_acq_rel); + if (m_expiry[bucket].compare_exchange_strong(expected, 0, + std::memory_order_acq_rel)) { + m_tokens[bucket].store(0, std::memory_order_release); + } return false; } @@ -102,6 +109,8 @@ namespace SPTAG::SPANN { std::size_t m_count; std::atomic m_ttlMs; std::unique_ptr[]> m_expiry; + std::unique_ptr[]> m_tokens; + std::atomic m_nextToken{0}; }; } // namespace SPTAG::SPANN diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 03851df1c..1b39f5bc2 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -52,7 +52,18 @@ namespace SPTAG::SPANN { std::string& appendPosting)>; using HeadSyncCallback = std::function; - using RemoteLockCallback = std::function; + // RemoteLockCallback: + // For Lock op: token argument is 0; returns issued fencing token + // (>=1 on success, 0 on denial). + // For Unlock op: token argument is the previously-issued token; + // returns 1 on accepted release, 0 if the token is + // stale (lease already expired / re-issued). + using RemoteLockCallback = std::function; + // Validator for fenced RemoteAppend: receiver checks the request's + // m_fencingToken against the lease table for headID's bucket. + // Return true to allow the append, false to reject (the response + // will carry Failed status). Unfenced appends (token=0) bypass. + using FenceValidator = std::function; /// Callback for cross-node merge: search on a peer node observed /// that posting `headID` (which we own) looks underfull. The peer @@ -152,6 +163,14 @@ namespace SPTAG::SPANN { EnsureLayerSlot_NoLock(layer); m_remoteLockCallbacks[layer] = std::move(cb); } + void SetFenceValidator(int layer, FenceValidator cb) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + if (static_cast(layer) >= m_fenceValidators.size()) { + m_fenceValidators.resize(layer + 1); + } + m_fenceValidators[layer] = std::move(cb); + } void SetMergeCallback(int layer, MergeCallback cb) { std::unique_lock lk(m_callbackLifetimeMutex); EnsureLayerSlot_NoLock(layer); @@ -169,6 +188,7 @@ namespace SPTAG::SPANN { m_headSyncCallbacks.clear(); m_remoteLockCallbacks.clear(); m_mergeCallbacks.clear(); + m_fenceValidators.clear(); m_callbackOwners = std::vector>(); } @@ -200,6 +220,9 @@ namespace SPTAG::SPANN { if (layer >= 0 && static_cast(layer) < m_mergeCallbacks.size()) { m_mergeCallbacks[layer] = nullptr; } + if (layer >= 0 && static_cast(layer) < m_fenceValidators.size()) { + m_fenceValidators[layer] = nullptr; + } m_callbackOwners[layer].store(nullptr, std::memory_order_release); return true; } @@ -220,6 +243,11 @@ namespace SPTAG::SPANN { const auto& cb = m_remoteLockCallbacks[layer]; return cb ? &cb : nullptr; } + const FenceValidator* LookupFenceValidator_Locked(int layer) const { + if (layer < 0 || static_cast(layer) >= m_fenceValidators.size()) return nullptr; + const auto& cb = m_fenceValidators[layer]; + return cb ? &cb : nullptr; + } // PutPosting/FetchPosting/DeletePosting RPCs lived here historically. // With shared TiKV every node reads and writes the posting store // directly (PD routes the key), so the cross-node scatter-gather @@ -240,7 +268,8 @@ namespace SPTAG::SPANN { SizeType headID, const std::shared_ptr& headVec, int appendNum, - std::string& appendPosting) + std::string& appendPosting, + std::uint64_t fencingToken = 0) { Socket::ConnectionID connID = m_net->GetPeerConnection(targetNodeIndex); if (connID == Socket::c_invalidConnectionID) { @@ -256,6 +285,7 @@ namespace SPTAG::SPANN { req.m_headVec = *headVec; req.m_appendNum = appendNum; req.m_appendPosting = appendPosting; + req.m_fencingToken = fencingToken; Socket::ResourceID resID = m_nextResourceId.fetch_add(1); auto [future, _] = CreatePendingResponse(resID); @@ -632,18 +662,25 @@ namespace SPTAG::SPANN { // RemoteLock — synchronous request/response // ================================================================== - bool SendRemoteLock(int nodeIndex, int layer, SizeType headID, bool lock) { + // SendRemoteLock: synchronous lock/unlock RPC. + // For Lock (lock=true, token=0): returns issued fencing token, + // 0 on denial/timeout. + // For Unlock (lock=false, token=t): returns 1 on accepted release, + // 0 on rejection/timeout. + std::uint64_t SendRemoteLock(int nodeIndex, int layer, SizeType headID, + bool lock, std::uint64_t token = 0) { Socket::ConnectionID connID = m_net->GetPeerConnection(nodeIndex); if (connID == Socket::c_invalidConnectionID) { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "RemotePostingOps: Cannot send remote lock to node %d\n", nodeIndex); - return false; + return 0; } RemoteLockRequest req; req.m_op = lock ? RemoteLockRequest::Op::Lock : RemoteLockRequest::Op::Unlock; req.m_headID = headID; req.m_layer = layer; + req.m_token = token; Socket::ResourceID rid = m_nextResourceId.fetch_add(1); auto [future, _] = CreatePendingResponse(rid); @@ -666,12 +703,18 @@ namespace SPTAG::SPANN { auto status = future.wait_for(std::chrono::milliseconds(5000)); if (status != std::future_status::ready) { ErasePending(rid); + TakePendingLockToken(rid); SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "RemotePostingOps: Lock timeout for headID %lld on node %d\n", (std::int64_t)headID, nodeIndex); - return false; + return 0; } - return future.get() == ErrorCode::Success; + ErrorCode ec = future.get(); + std::uint64_t returnedToken = TakePendingLockToken(rid); + if (ec != ErrorCode::Success) return 0; + // On Unlock the owner returns token=0 but Success status; map + // to a sentinel 1 so callers can distinguish from failure. + return lock ? returnedToken : (returnedToken == 0 ? 1 : returnedToken); } // ================================================================== @@ -701,6 +744,24 @@ namespace SPTAG::SPANN { ErrorCode result = ErrorCode::Fail; { std::shared_lock cbLock(m_callbackLifetimeMutex); + // Fence validation: if the request carries a nonzero + // fencing token, the writer claimed they held the remote + // lock for this head when they sent the RPC. Validate + // against our lease table before applying so a zombie + // holder's late write (after its lease expired) is + // rejected. + if (req.m_fencingToken != 0) { + const auto* fv = LookupFenceValidator_Locked(req.m_layer); + if (fv && !(*fv)(req.m_headID, req.m_fencingToken)) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: AppendRequest fencing token " + "%llu rejected for headID %lld (stale lease)\n", + (unsigned long long)req.m_fencingToken, + (std::int64_t)req.m_headID); + SendAppendResponse(packet, RemoteAppendResponse::Status::Failed); + return; + } + } const auto* cb = LookupAppendCallback_Locked(req.m_layer); if (cb) { auto headVec = std::make_shared(std::move(req.m_headVec)); @@ -967,14 +1028,18 @@ namespace SPTAG::SPANN { RemoteLockResponse resp; resp.m_status = RemoteLockResponse::Status::Denied; + resp.m_token = 0; { std::shared_lock cbLock(m_callbackLifetimeMutex); const auto* cb = LookupRemoteLockCallback_Locked(req.m_layer); if (cb) { bool isLock = (req.m_op == RemoteLockRequest::Op::Lock); - bool success = (*cb)(req.m_headID, isLock); - if (success) resp.m_status = RemoteLockResponse::Status::Granted; + std::uint64_t out = (*cb)(req.m_headID, isLock, req.m_token); + if (out != 0) { + resp.m_status = RemoteLockResponse::Status::Granted; + resp.m_token = isLock ? out : 0; + } } else { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "RemotePostingOps: RemoteLockRequest layer=%d has no callback registered\n", @@ -1007,6 +1072,13 @@ namespace SPTAG::SPANN { return; } + // Stash the issued fencing token so SendRemoteLock can pick + // it up after the future signals. + if (resp.m_status == RemoteLockResponse::Status::Granted && resp.m_token != 0) { + std::lock_guard lk(m_pendingLockTokensMutex); + m_pendingLockTokens[rid] = resp.m_token; + } + promise->set_value(resp.m_status == RemoteLockResponse::Status::Granted ? ErrorCode::Success : ErrorCode::Fail); } @@ -1026,6 +1098,15 @@ namespace SPTAG::SPANN { m_pendingResponses.erase(resID); } + std::uint64_t TakePendingLockToken(Socket::ResourceID rid) { + std::lock_guard lk(m_pendingLockTokensMutex); + auto it = m_pendingLockTokens.find(rid); + if (it == m_pendingLockTokens.end()) return 0; + std::uint64_t tok = it->second; + m_pendingLockTokens.erase(it); + return tok; + } + /// Take a pending promise out of the map (returns nullptr if not found). std::unique_ptr> TakePendingResponse(Socket::ResourceID resID) { std::lock_guard lock(m_pendingMutex); @@ -1221,6 +1302,7 @@ namespace SPTAG::SPANN { std::vector m_headSyncCallbacks; std::vector m_remoteLockCallbacks; std::vector m_mergeCallbacks; + std::vector m_fenceValidators; // Per-layer ownership tokens. Each ExtraDynamicSearcher claims its // layer slot at SetWorker time and releases it on destruction; this @@ -1239,6 +1321,15 @@ namespace SPTAG::SPANN { std::mutex m_pendingMutex; std::unordered_map> m_pendingResponses; + // Side table populated by HandleRemoteLockResponse: maps the + // outstanding RPC resource id to the fencing token returned by + // the owner. SendRemoteLock reads this immediately after the + // future signals to retrieve the token without needing to widen + // the m_pendingResponses promise type (which is shared with the + // Append/HeadSync RPCs). + std::mutex m_pendingLockTokensMutex; + std::unordered_map m_pendingLockTokens; + // Per-item Job: each remote append request becomes one Job submitted // to the searcher's shared SPDKThreadPool. The last completing Job // ACKs the sender. Identical to how a local insert thread would call diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index 40d537379..4675383b1 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -38,6 +38,7 @@ namespace SPTAG::SPANN { using DispatchCallback = DispatchCoordinator::DispatchCallback; using HeadSyncCallback = RemotePostingOps::HeadSyncCallback; using RemoteLockCallback = RemotePostingOps::RemoteLockCallback; + using FenceValidator = RemotePostingOps::FenceValidator; /// Initialize with separate dispatcher/worker/store addresses. /// workerIndex is 0-based (0 = driver/local, 1+ = remote). @@ -111,6 +112,7 @@ namespace SPTAG::SPANN { void SetAppendCallback(int layer, AppendCallback cb) { m_remoteOps.SetAppendCallback(layer, std::move(cb)); } void SetHeadSyncCallback(int layer, HeadSyncCallback cb) { m_remoteOps.SetHeadSyncCallback(layer, std::move(cb)); } void SetRemoteLockCallback(int layer, RemoteLockCallback cb) { m_remoteOps.SetRemoteLockCallback(layer, std::move(cb)); } + void SetFenceValidator(int layer, FenceValidator cb) { m_remoteOps.SetFenceValidator(layer, std::move(cb)); } // Inject the searcher's shared compute pool so receiver-side // BatchAppend work runs there (high-priority Jobs) instead of in a // separate executor. Idempotent: safe to call multiple times. @@ -226,9 +228,24 @@ namespace SPTAG::SPANN { m_remoteOps.NoteHeadSyncApplyDelete(); } - bool SendRemoteLock(int nodeIndex, int layer, SizeType headID, bool lock) { - if (!m_enabled) return false; - return m_remoteOps.SendRemoteLock(nodeIndex, layer, headID, lock); + // Returns issued fencing token on Lock success (0 = denied), + // or 1 on Unlock accepted (0 = rejected / stale token). + std::uint64_t SendRemoteLock(int nodeIndex, int layer, SizeType headID, + bool lock, std::uint64_t token = 0) { + if (!m_enabled) return 0; + return m_remoteOps.SendRemoteLock(nodeIndex, layer, headID, lock, token); + } + + // Synchronous, fenced remote append: includes the fencing token + // so the owner can validate that the writer still holds the + // bucket lease before applying. Returns Success/Fail. + ErrorCode SendFencedRemoteAppend(int nodeIndex, int layer, SizeType headID, + const std::shared_ptr& headVec, + int appendNum, std::string& appendPosting, + std::uint64_t fencingToken) { + if (!m_enabled) return ErrorCode::Fail; + return m_remoteOps.SendRemoteAppend(nodeIndex, layer, headID, headVec, + appendNum, appendPosting, fencingToken); } void SetMergeCallback(int layer, RemotePostingOps::MergeCallback cb) { diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 6e7f35eb3..8720a63c4 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -596,23 +596,41 @@ namespace SPTAG::SPANN { } }); - // Remote lock callback: per-bucket leases with TTL auto-release. - m_worker->SetRemoteLockCallback(m_layer, [this](SizeType headID, bool lock) -> bool { + // Remote lock callback: per-bucket leases with TTL auto-release + // AND a fencing token. The owner returns a monotonically + // increasing token on Lock; subsequent fenced operations + // (RemoteAppend with m_fencingToken set) carry that token + // and the owner validates it against this lease table before + // applying. A zombie holder whose lease has expired (and + // bucket been re-acquired) will have its late operations + // rejected. + m_worker->SetRemoteLockCallback(m_layer, + [this](SizeType headID, bool lock, std::uint64_t token) -> std::uint64_t { unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex(static_cast(headID)); if (lock) { - if (!m_remoteLeaseTable->TryAcquire(bucket)) return false; + std::uint64_t tok = m_remoteLeaseTable->TryAcquire(bucket); + if (tok == 0) return 0; if (!m_rwLocks[headID].try_lock()) { - m_remoteLeaseTable->Release(bucket); - return false; + m_remoteLeaseTable->Release(bucket, tok); + return 0; } m_rwLocks[headID].unlock(); - return true; + return tok; } else { - m_remoteLeaseTable->Release(bucket); - return true; + return m_remoteLeaseTable->Release(bucket, token) ? 1 : 0; } }); + // Fenced RemoteAppend validator: the receive-side gate for + // split's cross-owner posting writes. A nonzero fencing + // token in the request must match the current lease for + // that head's bucket. + m_worker->SetFenceValidator(m_layer, + [this](SizeType headID, std::uint64_t token) -> bool { + unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex(static_cast(headID)); + return m_remoteLeaseTable->Validate(bucket, token); + }); + // Cross-node merge hint callback m_worker->SetMergeCallback(m_layer, [this](SizeType headID) { MergeAsync(headID); From 74c0350cdb7fd2154839f1e082246487bdd0be05 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 11:10:36 +0000 Subject: [PATCH 23/51] SPANN distributed: wire split path through fenced cross-owner write Replace the two TryRouteRemoteAppend call sites in Split (existing-head merge path and new-head create path) with the synchronous TryWriteRemoteSplitChildFenced helper when the new head is remote-owned. The helper performs try-lock-both, writes a SplitWAL Begin record, sends a fenced RemoteAppend with the lock's monotonic token, then releases the lock and clears the WAL on success. On fenced-write failure (lock contention or RPC error), fall back to the legacy async TryRouteRemoteAppend so the posting is not stranded; the WAL + watchdog converge eventually. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 159 ++++++++++++++++-- 1 file changed, 143 insertions(+), 16 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 8720a63c4..f0a95ae93 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -715,6 +715,99 @@ namespace SPTAG::SPANN { return true; } + // Synchronous, fenced cross-owner write used by the Split path. + // Per the design's Split Happy Path: + // * The split holder already holds the local source-head lock. + // * For the remote child it must acquire the remote lock with a + // try-and-backoff protocol (try-lock-both). Failure here + // means another node is racing; abort so the caller can + // re-enqueue via SplitAsync. + // * The remote posting write is fenced (token attached) so a + // zombie holder past lease expiry cannot resurrect this + // write after another holder took over. + // * A WAL record is written before the cross-owner posting + // write and cleared on success. On failure the WAL drives a + // GC pass to delete the orphan partner posting (see + // SplitWAL.h); GC is best-effort and only affects recall. + // + // Returns Success on both-locked-and-written, Fail otherwise. + // On failure the caller should leave any partial state to the + // GC pass and re-enqueue the split. + ErrorCode TryWriteRemoteSplitChildFenced(SizeType srcHeadID, + SizeType remoteChildHeadID, + const void* remoteChildHeadVecBytes, + int appendNum, + std::string& posting) { + int ownerNode = -1; + if (!IsRemoteOwnedHead(remoteChildHeadID, &ownerNode)) { + return ErrorCode::Fail; + } + if (!m_worker || !m_worker->IsEnabled()) return ErrorCode::Fail; + + // Try-lock-both: acquire remote lock with bounded retry. + std::uint64_t token = 0; + constexpr int kMaxLockRetries = 5; + for (int attempt = 0; attempt < kMaxLockRetries; ++attempt) { + token = m_worker->SendRemoteLock(ownerNode, m_layer, + remoteChildHeadID, true, 0); + if (token != 0) break; + std::this_thread::sleep_for( + std::chrono::milliseconds(5 * (attempt + 1))); + } + if (token == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: failed to acquire remote lock for child %lld on node %d " + "after %d retries; abort and re-enqueue\n", + (std::int64_t)remoteChildHeadID, ownerNode, kMaxLockRetries); + return ErrorCode::Fail; + } + + // Write WAL Begin so a crash after the remote write but + // before completion is recoverable via GC. + std::uint64_t jobID = m_splitJobIdCounter.fetch_add(1) + 1; + if (m_splitWAL) { + Distributed::SplitWAL::Record r; + r.jobID = jobID; + r.srcHeadID = srcHeadID; + r.localChildHeadID = 0; + r.remoteChildHeadID = remoteChildHeadID; + r.remoteOwnerNodeIndex = ownerNode; + r.startTimestampSec = + std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); + r.stage = Distributed::SplitWAL::Stage::Begin; + m_splitWAL->Write(r); + } + + // Fenced sync remote append. Receiver validates the token + // against its lease table before applying. + auto headVec = std::make_shared( + static_cast(remoteChildHeadVecBytes), + m_vectorDataSize); + ErrorCode ec = m_worker->SendFencedRemoteAppend( + ownerNode, m_layer, remoteChildHeadID, headVec, + appendNum, posting, token); + + // Release the remote lock with the issued token. If our + // lease has expired in the meantime, Release will no-op on + // the owner side (the new holder's token won't match ours). + m_worker->SendRemoteLock(ownerNode, m_layer, remoteChildHeadID, + false, token); + + if (ec == ErrorCode::Success) { + // Clear WAL: both writes done. (The local-side Put + // happens in the caller's loop using the existing + // PutPostingToDB path.) + if (m_splitWAL) m_splitWAL->Clear(srcHeadID, jobID); + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: fenced remote append failed for child %lld " + "on node %d (ec=%d); WAL kept for GC\n", + (std::int64_t)remoteChildHeadID, ownerNode, (int)ec); + } + return ec; + } + // Validate (and lazily extend) the local version map so that // every (vid, ver) tuple in a posting we are about to write is // representable. Without this, remote-originated postings carrying @@ -1269,15 +1362,35 @@ namespace SPTAG::SPANN { m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); // If newHeadVID's owner is a remote node, route - // the new posting via RemoteAppend; the owner - // will merge it into the existing posting list. - if (TryRouteRemoteAppend( - newHeadVID, + // the new posting via a fenced cross-owner write: + // acquire the remote lock, send a fenced + // RemoteAppend (sync), and let the owner merge + // it into the existing posting list. See + // TryWriteRemoteSplitChildFenced for the + // try-lock-both + WAL + fencing protocol. + if (IsRemoteOwnedHead(newHeadVID)) { + ErrorCode fec = TryWriteRemoteSplitChildFenced( + headID, newHeadVID, + args.centers + k * args._D, (int)(newPostingLists[k].size() / m_vectorInfoSize), - newPostingLists[k], - args.centers + k * args._D)) { - if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); - continue; + newPostingLists[k]); + if (fec == ErrorCode::Success) { + if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); + continue; + } + // Fall through: on remote-lock contention + // or send failure, fall back to the legacy + // async TryRouteRemoteAppend so we don't + // strand the posting. Watchdog + WAL GC + // converge eventually. + if (TryRouteRemoteAppend( + newHeadVID, + (int)(newPostingLists[k].size() / m_vectorInfoSize), + newPostingLists[k], + args.centers + k * args._D)) { + if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); + continue; + } } std::string mergedPostingList; @@ -1366,19 +1479,33 @@ namespace SPTAG::SPANN { SplitAsync(newHeadVID, currentLength); } } else { - // If newHeadVID's owner is a remote node, route - // the initial posting via RemoteAppend so it - // ends up in the owner's TiKV. We still add the + // If newHeadVID's owner is a remote node, do the + // fenced cross-owner write: try-lock-both + WAL + // + sync fenced RemoteAppend. We still add the // head locally and rely on BroadcastHeadSync // (after this loop) to spread the head index // update to all nodes. The receiver's // AppendCallback materializes the head if its // HeadSync hasn't arrived yet. - bool remoteCreated = TryRouteRemoteAppend( - newHeadVID, - (int)(newPostingLists[k].size() / m_vectorInfoSize), - newPostingLists[k], - args.centers + k * args._D); + bool remoteCreated = false; + if (IsRemoteOwnedHead(newHeadVID)) { + ErrorCode fec = TryWriteRemoteSplitChildFenced( + headID, newHeadVID, + args.centers + k * args._D, + (int)(newPostingLists[k].size() / m_vectorInfoSize), + newPostingLists[k]); + if (fec == ErrorCode::Success) { + remoteCreated = true; + } else { + // Fall back to async queue: WAL + + // watchdog converge eventually. + remoteCreated = TryRouteRemoteAppend( + newHeadVID, + (int)(newPostingLists[k].size() / m_vectorInfoSize), + newPostingLists[k], + args.centers + k * args._D); + } + } if (!remoteCreated) { auto splitPutBegin = std::chrono::high_resolution_clock::now(); From de3fa64a2e8449dd234caf54674704762a8056ec Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 12:45:52 +0000 Subject: [PATCH 24/51] SPANN distributed: route inner layers, retire async-job UAF, larger RPC chunks, remote stats * Drop the m_layer != 0 short-circuit in IsRemoteOwnedHead. Both layers store postings in the same TiKV cluster (DBKey = m_maxID*m_layer+postingID) and need owner-ring routing, fencing, and SplitWAL just like layer 0. HeadSync broadcast stays layer-0-only since layer-1 centroids are derived from layer-0 splits and reach peers via that broadcast. SplitWAL keys now carry the layer to avoid collisions across layers. * Fix MergeAsyncJob / SplitAsyncJob retry use-after-free: the SPDKThreadPool worker unconditionally deletes the Job after exec() returns, so the prior 'add this; return;' retry path freed the Job while it was still queued. Enqueue a fresh Job carrying the bumped attempt count instead. * Bump RemoteAppendChunkSize 3000->10000 and RemoteAppendMaxInflight 4->8. Per-chunk grpc framing was dominating, and with replica fan-out =8 the outbound queue at 1M+1M scale ships ~8M items; larger chunks amortize send overhead ~3x. * Add remote queue stats to layer progress + ALL DONE logs and gate the ALL DONE boundary on the outbound queue draining. Previously ALL DONE fired as soon as local SPDK pool was empty, even though the network pump was still shipping millions of fan-out items, making runs look stuck for tens of minutes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/Distributed/SplitWAL.h | 13 +-- .../inc/Core/SPANN/Distributed/WorkerNode.h | 17 ++++ .../inc/Core/SPANN/ExtraDynamicSearcher.h | 89 ++++++++++++++----- .../inc/Core/SPANN/ParameterDefinitionList.h | 10 ++- 4 files changed, 98 insertions(+), 31 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h b/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h index 1bc84b052..3cd642a13 100644 --- a/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h +++ b/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h @@ -66,12 +66,13 @@ class SplitWAL { } }; - explicit SplitWAL(std::shared_ptr db) : m_db(std::move(db)) {} + explicit SplitWAL(std::shared_ptr db, int layer = 0) + : m_db(std::move(db)), m_layer(layer) {} // Write or update a WAL record. Stage transitions are monotonic. bool Write(const Record& r) { if (!m_db) return false; - auto ec = m_db->Put(MakeKey(r.srcHeadID, r.jobID), r.Encode(), kTimeout, nullptr); + auto ec = m_db->Put(MakeKey(m_layer, r.srcHeadID, r.jobID), r.Encode(), kTimeout, nullptr); if (ec != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "SplitWAL::Write head=%lld job=%llu stage=%u failed (%d)\n", @@ -85,17 +86,19 @@ class SplitWAL { // Remove a completed WAL record after both writes succeeded. bool Clear(SizeType srcHeadID, std::uint64_t jobID) { if (!m_db) return false; - std::vector k{ MakeKey(srcHeadID, jobID) }; + std::vector k{ MakeKey(m_layer, srcHeadID, jobID) }; return m_db->MultiDelete(k, kTimeout) == ErrorCode::Success; } - static std::string MakeKey(SizeType srcHeadID, std::uint64_t jobID) { - return "wal/split/" + std::to_string(srcHeadID) + "/" + std::to_string(jobID); + static std::string MakeKey(int layer, SizeType srcHeadID, std::uint64_t jobID) { + return "wal/split/" + std::to_string(layer) + "/" + + std::to_string(srcHeadID) + "/" + std::to_string(jobID); } private: static constexpr auto kTimeout = std::chrono::microseconds(2'000'000); std::shared_ptr m_db; + int m_layer = 0; }; } // namespace Distributed diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index 4675383b1..e18c9557d 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -262,6 +262,7 @@ namespace SPTAG::SPANN { auto& q = m_appendQueue[nodeIndex]; q.push_back(std::move(req)); m_remoteQueueSize.fetch_add(1, std::memory_order_relaxed); + m_totalRemoteAppendsRouted.fetch_add(1, std::memory_order_relaxed); // [PERF] Auto-flush per node once we have a full chunk worth // (kAutoFlushThreshold items). Without this, every remote // append accumulates until end-of-batch FlushRemoteAppends — @@ -340,6 +341,19 @@ namespace SPTAG::SPANN { return m_remoteQueueSize.load(std::memory_order_relaxed); } + // Number of remote append items submitted via QueueRemoteAppend over + // this WorkerNode's lifetime. Used by ExtraDynamicSearcher progress + // logging so users can tell whether "ALL DONE" on the local pool is + // misleading because the remote send queue still has backlog. + size_t GetTotalRemoteAppendsRouted() const { + return m_totalRemoteAppendsRouted.load(std::memory_order_relaxed); + } + // In-flight chunk count across all peers (auto-flush async sends + // currently running). + int GetInflightAppendFlushes() const { + return m_inflightAppendFlushes.load(std::memory_order_relaxed); + } + ErrorCode FlushRemoteAppends() { // Drain the queue under m_flushMutex so concurrent flush callers // serialize. Loop in case items get queued mid-send. This avoids @@ -615,6 +629,9 @@ namespace SPTAG::SPANN { mutable std::mutex m_appendQueueMutex; std::unordered_map> m_appendQueue; std::atomic m_remoteQueueSize{0}; + // Cumulative count of items handed to QueueRemoteAppend over this + // worker's lifetime (does not decrement on send completion). + std::atomic m_totalRemoteAppendsRouted{0}; // Serializes concurrent FlushRemoteAppends() callers so we don't open // hundreds of simultaneous RPC streams to the remote worker (which has // only 8 server threads / 256 connection slots). With this mutex, only diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index f0a95ae93..44d3d63c9 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -84,15 +84,19 @@ namespace SPTAG::SPANN { // Async-job fault-tolerance contract: merges are // safe to retry idempotently (the owner check, the // ContainSample liveness gate, and the locked RMW - // all re-evaluate on each attempt). Re-enqueue - // without touching m_mergeJobsInFlight so the - // outer "wait for in-flight" loop still sees us. - ++m_attempts; + // all re-evaluate on each attempt). Enqueue a + // fresh Job carrying the bumped attempt count — + // the ThreadPool worker will `delete` *this* after + // we return, so we cannot re-add the same pointer. + // Keep m_mergeJobsInFlight unchanged: the new job + // takes ownership of the in-flight slot. SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "MergeAsyncJob: head=%lld attempt=%d failed ret=%d, re-enqueueing\n", - (std::int64_t)m_headID, m_attempts, (int)ret); - m_extraIndex->m_splitThreadPool->add(this); - return; // skip cleanup; Job lives on + (std::int64_t)m_headID, m_attempts + 1, (int)ret); + auto* retryJob = new MergeAsyncJob(m_extraIndex, m_headID, m_callback); + retryJob->m_attempts = m_attempts + 1; + m_extraIndex->m_splitThreadPool->add(retryJob); + return; } m_extraIndex->m_asyncStatus = ret; SPTAGLIB_LOG(Helper::LogLevel::LL_Error, @@ -137,11 +141,14 @@ namespace SPTAG::SPANN { // See MergeAsyncJob: splits are designed safe to // retry from any compute node (read-deduplicate // during the next attempt handles partial writes). - ++m_attempts; + // Enqueue a fresh Job — the ThreadPool worker will + // `delete` *this* after we return. SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "SplitAsyncJob: head=%lld attempt=%d failed ret=%d, re-enqueueing\n", - (std::int64_t)m_headID, m_attempts, (int)ret); - m_extraIndex->m_splitThreadPool->add(this); + (std::int64_t)m_headID, m_attempts + 1, (int)ret); + auto* retryJob = new SplitAsyncJob(m_extraIndex, m_headID, m_callback); + retryJob->m_attempts = m_attempts + 1; + m_extraIndex->m_splitThreadPool->add(retryJob); return; } m_extraIndex->m_asyncStatus = ret; @@ -504,14 +511,18 @@ namespace SPTAG::SPANN { } // Initialize durable HeadSync log + SplitWAL once we know the - // worker (and therefore the node identity). Both are layer-0 - // concerns: only layer 0 actually broadcasts HeadSync and - // performs cross-owner splits. See Distributed/HeadSyncLog.h - // and Distributed/SplitWAL.h. - if (m_layer == 0 && db) { - m_headSyncLog = std::make_unique( - db, m_worker->GetWorkerNodeIndex()); - m_splitWAL = std::make_unique(db); + // worker (and therefore the node identity). Both layers + // perform cross-owner splits, so both layers need a WAL. + // HeadSync, however, only broadcasts the layer-0 head topology + // (layer-1 centroids are derived from layer-0 splits and reach + // peers via the layer-0 HeadSync, so layer 1 doesn't need its + // own broadcast log). + if (db) { + if (m_layer == 0) { + m_headSyncLog = std::make_unique( + db, m_worker->GetWorkerNodeIndex()); + } + m_splitWAL = std::make_unique(db, m_layer); } WireJobSubmitterIfReady(); @@ -682,18 +693,20 @@ namespace SPTAG::SPANN { } // Single source of truth for "this head lives on a different node". - // Only the outer (head) layer participates in the owner-ring route; - // inner layers (m_layer > 0) hold per-node-local state with no - // shared VID space and no cross-node TiKV key contract, so they - // always answer false. When true, outNodeIndex (if not null) is - // populated with the owner's node index. + // Applies to every layer that has a TiKV-backed posting list, since + // DBKey(headID) = m_maxID*m_layer + headID means each layer's keys + // live in the same shared TiKV cluster and are owned by whichever + // node the owner ring assigns. Layer 0 (leaf vector postings) and + // layer 1+ (centroid postings written by recursive AddHeadIndex / + // DeleteIndex during a Split) both go through here. When true, + // outNodeIndex (if not null) is populated with the owner's node + // index. // // Every Split / Merge / Append code path that might touch a head // it doesn't own MUST gate on this predicate so the invariant // (only owners mutate their own postings) is enforced in exactly // one place. bool IsRemoteOwnedHead(SizeType headID, int* outNodeIndex = nullptr) { - if (m_layer != 0) return false; if (!m_worker || !m_worker->IsEnabled()) return false; auto target = m_worker->GetOwner(headID); if (target.isLocal) return false; @@ -3685,18 +3698,44 @@ namespace SPTAG::SPANN { size_t completed = m_totalSplitCompleted.load(); double avgSplitMs = completed > 0 ? (m_totalSplitTimeUs.load() / 1000.0 / completed) : 0; double maxSplitMs = m_maxSplitTimeUs.load() / 1000.0; + // Remote queue stats are layer-agnostic (one queue per + // WorkerNode covers every layer's outbound appends); only + // emit them when m_worker is wired so single-node baselines + // stay quiet. + size_t remoteQ = 0, remoteTotal = 0; + int remoteInflight = 0; + if (m_worker) { + remoteQ = m_worker->GetRemoteQueueSize(); + remoteTotal = m_worker->GetTotalRemoteAppendsRouted(); + remoteInflight = m_worker->GetInflightAppendFlushes(); + } SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "layer %d pending queue:%zu split:%zu merge:%zu append:%zu reassign:%zu running:%u | " "total_submitted split:%zu merge:%zu reassign:%zu append:%zu | " "total_completed split:%zu merge:%zu reassign:%zu | " + "remote queueDepth:%zu inflightChunks:%d totalRouted:%zu | " "split_latency avg:%.1fms max:%.1fms\n", m_layer, totalJobs, m_splitJobsInFlight.load(), m_mergeJobsInFlight.load(), m_appendJobsInFlight.load(), m_reassignJobsInFlight.load(), runningJobs, m_totalSplitSubmitted.load(), m_totalMergeSubmitted.load(), m_totalReassignSubmitted.load(), m_totalAppendCount.load(), m_totalSplitCompleted.load(), m_totalMergeCompleted.load(), m_totalReassignCompleted.load(), + remoteQ, remoteInflight, remoteTotal, avgSplitMs, maxSplitMs); } if (runningJobs == 0 && totalJobs == 0) { + // Hold ALL DONE until the outbound remote-append queue and + // any in-flight chunks have also drained. Otherwise users + // see "ALL DONE" while the network pump is still shipping + // millions of fanned-out items to peers (see ReplicaCount=8 + // amplification path), giving a misleading "stuck" feel. + size_t remoteQ = 0; int remoteInflight = 0; + if (m_worker) { + remoteQ = m_worker->GetRemoteQueueSize(); + remoteInflight = m_worker->GetInflightAppendFlushes(); + } + if (remoteQ != 0 || remoteInflight != 0) { + return false; + } if (!m_allDonePrinted) { size_t totalSplit = m_totalSplitSubmitted.load(); size_t totalMerge = m_totalMergeSubmitted.load(); @@ -3708,9 +3747,11 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "layer %d ALL DONE | total_submitted split:%zu merge:%zu reassign:%zu append:%zu | " "total_completed split:%zu merge:%zu reassign:%zu | " + "remote totalRouted:%zu | " "split_latency avg:%.1fms max:%.1fms\n", m_layer, totalSplit, totalMerge, m_totalReassignSubmitted.load(), totalAppend, m_totalSplitCompleted.load(), m_totalMergeCompleted.load(), m_totalReassignCompleted.load(), + (m_worker ? m_worker->GetTotalRemoteAppendsRouted() : 0), avgSplitMs, maxSplitMs); // [DIAG] dump diagnostic histograms (lock/RMW/grpc/byte) at every ALL DONE boundary { diff --git a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h index 700a5d592..73f7c9a48 100644 --- a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h +++ b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h @@ -126,10 +126,16 @@ DefineSSDParameter(m_versionCacheMaxChunks, int, 10000, "VersionCacheMaxChunks") DefineSSDParameter(m_asyncRpcMaxInflight, int, 0, "AsyncRpcMaxInflight") // Distributed RemotePostingOps RPC tuning -DefineSSDParameter(m_remoteAppendChunkSize, int, 3000, "RemoteAppendChunkSize") +// ChunkSize=10000: each in-flight chunk holds enough work to amortize the +// network roundtrip and grpc framing cost (a 3000-item chunk took ~500ms at +// 1M-scale; 10000 should hit ~1.5s and roughly 3× the per-second throughput +// for the same in-flight cap). +DefineSSDParameter(m_remoteAppendChunkSize, int, 10000, "RemoteAppendChunkSize") DefineSSDParameter(m_remoteAppendRetry, int, 3, "RemoteAppendRetry") DefineSSDParameter(m_remoteAppendTimeoutSec, int, 180, "RemoteAppendTimeoutSec") -DefineSSDParameter(m_remoteAppendMaxInflight, int, 4, "RemoteAppendMaxInflight") +// MaxInflight=8 (was 4): keeps the receiver's 16-thread BatchAppendItemJob pool +// well-fed even when one chunk straggles on lock contention. +DefineSSDParameter(m_remoteAppendMaxInflight, int, 8, "RemoteAppendMaxInflight") DefineSSDParameter(m_asyncJobMaxRetry, int, 3, "AsyncJobMaxRetry") DefineSSDParameter(m_remoteLockTtlMs, int, 30000, "RemoteLockTtlMs") From 06d889930f21033ed6574a12c591eba792e3e252 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 14:18:59 +0000 Subject: [PATCH 25/51] feat(distributed): receiver-side durable Batch WAL for RemoteAppend (Option A) When a worker receives a BatchRemoteAppendRequest from a peer, instead of holding the connection open until every item has been applied (which made big chunks block long enough to trigger sender timeouts and full-chunk retries), it now: 1. Serializes the batch and Put()s it to TiKV under wal/rappend// 2. Immediately ACKs the sender as 'Accepted'. 3. Submits the per-item Append jobs onto the per-layer searcher pool. 4. On last-item completion, deletes the WAL key (best-effort). On startup, layer-0's SetWorker scans the WAL prefix and re-submits any batches durably accepted before a previous crash. The Append callback is already idempotent (versionMap dedup), so duplicate replays are safe. Implementation: - New BatchAppendWAL helper (mirrors SplitWAL's style). - New KeyValueIO::ScanPrefix(prefix, out, max) virtual; TiKVIO implements it via paged RawScan with logical-key stripping. Default is no-op so non-TiKV backends keep compiling. - RemotePostingOps::HandleBatchAppendRequest now WAL-then-ACK-then-submit, with a graceful fallback to the legacy synchronous-ACK path if the WAL Put fails. Shared item-dispatch logic is factored out into SubmitBatchItems for reuse by RecoverPendingBatches. - BatchAppendItemJob takes sendResponse/batchID flags so the same job serves both the WAL-backed path (delete WAL on last completion) and the legacy path (ACK on last completion). - ExtraDynamicSearcher::SetWorker constructs the WAL once (layer 0 only, scoped by receiver node) and triggers recovery after callbacks are wired. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/BatchAppendWAL.h | 119 ++++++++++++ .../Core/SPANN/Distributed/RemotePostingOps.h | 171 +++++++++++++++--- .../inc/Core/SPANN/Distributed/WorkerNode.h | 8 + .../inc/Core/SPANN/ExtraDynamicSearcher.h | 44 +++-- .../inc/Core/SPANN/ExtraTiKVController.h | 87 +++++++++ AnnService/inc/Helper/KeyValueIO.h | 13 ++ 6 files changed, 405 insertions(+), 37 deletions(-) create mode 100644 AnnService/inc/Core/SPANN/Distributed/BatchAppendWAL.h diff --git a/AnnService/inc/Core/SPANN/Distributed/BatchAppendWAL.h b/AnnService/inc/Core/SPANN/Distributed/BatchAppendWAL.h new file mode 100644 index 000000000..6d9bd3315 --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/BatchAppendWAL.h @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef _SPTAG_SPANN_DISTRIBUTED_BATCHAPPENDWAL_H_ +#define _SPTAG_SPANN_DISTRIBUTED_BATCHAPPENDWAL_H_ + +#include "inc/Core/Common.h" +#include "inc/Helper/KeyValueIO.h" +#include "inc/Helper/Logging.h" + +#include +#include +#include +#include +#include +#include + +namespace SPTAG { +namespace SPANN { +namespace Distributed { + +// BatchAppendWAL: durable write-ahead log for accepted BatchRemoteAppend +// requests on the receiver side. +// +// Sender → Receiver flow with this WAL enabled: +// 1. Receiver decodes a BatchRemoteAppendRequest. +// 2. Receiver serializes the request blob and Put()s it under +// wal/rappend//. +// 3. Receiver ACKs the sender immediately ("Accepted"). +// 4. Receiver schedules the per-item Append jobs as before. +// 5. After every item in the batch has been processed, the receiver +// Delete()s the WAL key (best-effort). +// +// Recovery: at startup (after SetWorker has wired the searcher's +// append-callback and job submitter) the receiver scans +// `wal/rappend//` and re-submits each pending batch. +// Items are idempotent — the Append callback checks the versionMap and +// skips RMWs that are already at the recorded version, so duplicate +// replays after a crash do not corrupt postings. +// +// Key schema: +// wal/rappend// → raw BatchRemoteAppendRequest bytes +class BatchAppendWAL { +public: + explicit BatchAppendWAL(std::shared_ptr db, int receiverNode) + : m_db(std::move(db)), m_receiverNode(receiverNode) {} + + bool Enabled() const { return static_cast(m_db); } + + bool Put(std::uint64_t batchID, const std::string& blob) { + if (!m_db) return false; + auto ec = m_db->Put(MakeKey(m_receiverNode, batchID), blob, kTimeout, nullptr); + if (ec != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "BatchAppendWAL::Put node=%d batchID=%llu failed (%d)\n", + m_receiverNode, (unsigned long long)batchID, (int)ec); + return false; + } + return true; + } + + bool Delete(std::uint64_t batchID) { + if (!m_db) return false; + std::vector k{ MakeKey(m_receiverNode, batchID) }; + auto ec = m_db->MultiDelete(k, kTimeout); + if (ec != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "BatchAppendWAL::Delete node=%d batchID=%llu failed (%d) — recovery will replay\n", + m_receiverNode, (unsigned long long)batchID, (int)ec); + return false; + } + return true; + } + + // Returns all (batchID, blob) pairs currently durable for this receiver. + ErrorCode Scan(std::vector>& out) { + out.clear(); + if (!m_db) return ErrorCode::Undefined; + std::vector> kvs; + std::string prefix = MakePrefix(m_receiverNode); + auto ec = m_db->ScanPrefix(prefix, kvs, 0); + if (ec == ErrorCode::Undefined) { + // Backend without ScanPrefix support — no recovery, but logged + // so operators see the gap. + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "BatchAppendWAL::Scan: backend has no ScanPrefix; recovery skipped\n"); + return ec; + } + if (ec != ErrorCode::Success) return ec; + for (auto& kv : kvs) { + // kv.first looks like "wal/rappend//" + auto pos = kv.first.find_last_of('/'); + if (pos == std::string::npos) continue; + std::uint64_t batchID = 0; + try { batchID = std::stoull(kv.first.substr(pos + 1)); } + catch (...) { continue; } + out.emplace_back(batchID, std::move(kv.second)); + } + return ErrorCode::Success; + } + + static std::string MakePrefix(int receiverNode) { + return "wal/rappend/" + std::to_string(receiverNode) + "/"; + } + static std::string MakeKey(int receiverNode, std::uint64_t batchID) { + return MakePrefix(receiverNode) + std::to_string(batchID); + } + +private: + static constexpr auto kTimeout = std::chrono::microseconds(5'000'000); + std::shared_ptr m_db; + int m_receiverNode = -1; +}; + +} // namespace Distributed +} // namespace SPANN +} // namespace SPTAG + +#endif // _SPTAG_SPANN_DISTRIBUTED_BATCHAPPENDWAL_H_ diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 1b39f5bc2..88b2478a7 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -4,6 +4,7 @@ #pragma once #include "inc/Core/SPANN/Distributed/DistributedProtocol.h" +#include "inc/Core/SPANN/Distributed/BatchAppendWAL.h" #include "inc/Helper/ThreadPool.h" #include "inc/Socket/Client.h" #include "inc/Socket/Server.h" @@ -128,6 +129,59 @@ namespace SPTAG::SPANN { m_jobSubmitters[layer] = std::move(submitter); } + // Receiver-side durable Batch WAL (Option A): when set, every + // incoming BatchRemoteAppendRequest is persisted to the WAL and + // ACKed immediately ("Accepted"); the items are then processed + // asynchronously by the per-layer job submitters and the WAL key + // is deleted on completion. Crash recovery: RecoverPendingBatches + // re-submits any WAL entries that survived a crash. The Append + // callback is idempotent (versionMap dedup), so duplicate replays + // after a crash are safe. + void SetBatchAppendWAL(std::shared_ptr wal) { + std::unique_lock lk(m_callbackLifetimeMutex); + m_batchAppendWAL = std::move(wal); + } + std::shared_ptr GetBatchAppendWAL() const { + std::shared_lock lk(m_callbackLifetimeMutex); + return m_batchAppendWAL; + } + + // Replay any BatchRemoteAppend batches that were durably accepted + // before a previous crash. Call once after the per-layer append + // callbacks + job submitters have been wired. + void RecoverPendingBatches() { + std::shared_ptr wal; + { + std::shared_lock lk(m_callbackLifetimeMutex); + wal = m_batchAppendWAL; + } + if (!wal || !wal->Enabled()) return; + std::vector> entries; + auto ec = wal->Scan(entries); + if (ec != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: BatchAppendWAL scan failed (%d); skipping recovery\n", + (int)ec); + return; + } + if (entries.empty()) return; + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "RemotePostingOps: recovering %zu pending BatchAppend batches from WAL\n", + entries.size()); + for (auto& e : entries) { + auto batchReq = std::make_shared(); + const auto* p = reinterpret_cast(e.second.data()); + if (batchReq->Read(p, static_cast(e.second.size())) == nullptr) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: WAL batchID=%llu parse failed; dropping\n", + (unsigned long long)e.first); + wal->Delete(e.first); + continue; + } + SubmitBatchItems(batchReq, e.first, /*sendResponse=*/false, /*ackPacket=*/nullptr); + } + } + // Helper: ensure the per-layer registries are wide enough for `layer`. // Caller must hold m_callbackLifetimeMutex in exclusive mode. void EnsureLayerSlot_NoLock(int layer) { @@ -822,16 +876,65 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "RemotePostingOps: Received batch of %u appends\n", batchReq->m_count); - // Submit each item as a Job to the searcher's shared compute pool. - // Pool workers run the local Append callback exactly like a local - // insert would. Last completion ACKs the sender. This puts remote - // work on the SAME concurrency budget as local Split/Merge/Reassign - // — eliminating the over-subscribed TiKV behaviour of the old - // separate bg executor + transient sub-worker threads. + const size_t total = batchReq->m_items.size(); + if (total == 0) { + SendBatchAppendResponse(packet, 0, 0); + return; + } + + // Option A path: durable Batch WAL is wired. Persist the batch + // first, then ACK the sender as "Accepted" and process items + // asynchronously. If WAL writes fail we fall through to the + // legacy synchronous-ACK path so the sender still sees an + // honest success/fail count. + std::shared_ptr wal; + { + std::shared_lock lk(m_callbackLifetimeMutex); + wal = m_batchAppendWAL; + } + if (wal && wal->Enabled() && !m_jobSubmitters.empty()) { + std::uint64_t batchID = m_nextBatchID.fetch_add(1, std::memory_order_relaxed); + // Re-encode rather than reuse the inbound packet body to + // avoid pinning the receive buffer for the lifetime of the + // batch. + std::string blob; + blob.resize(batchReq->EstimateBufferSize()); + auto* end = batchReq->Write(reinterpret_cast(&blob[0])); + blob.resize(static_cast( + end - reinterpret_cast(blob.data()))); + if (wal->Put(batchID, blob)) { + // Durable — ACK immediately as Accepted (success=total). + SendBatchAppendResponse(packet, + static_cast(total), 0); + SubmitBatchItems(batchReq, batchID, + /*sendResponse=*/false, /*ackPacket=*/nullptr); + return; + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "RemotePostingOps: BatchAppendWAL Put failed batchID=%llu — " + "falling back to synchronous ACK\n", + (unsigned long long)batchID); + } + + // Legacy / fallback path: process items inline-or-async, ACK on + // the last item completion. Identical to pre-WAL behaviour. auto packetPtr = std::make_shared(std::move(packet)); + SubmitBatchItems(batchReq, /*batchID=*/0, + /*sendResponse=*/true, packetPtr); + } + + // Submit each item of `batchReq` to its per-layer job submitter. + // If sendResponse is true, the last completing job ACKs the sender + // via ackPacket. If sendResponse is false (WAL-backed path or + // crash recovery), the last completing job deletes the WAL entry + // identified by `batchID`. + void SubmitBatchItems(std::shared_ptr batchReq, + std::uint64_t batchID, + bool sendResponse, + std::shared_ptr ackPacket) { const size_t total = batchReq->m_items.size(); if (total == 0) { - SendBatchAppendResponse(*packetPtr, 0, 0); + if (sendResponse && ackPacket) SendBatchAppendResponse(*ackPacket, 0, 0); return; } auto remaining = std::make_shared>(total); @@ -839,8 +942,6 @@ namespace SPTAG::SPANN { auto failCount = std::make_shared>(0); if (m_jobSubmitters.empty()) { - // Fallback: process inline on the network thread. Should not - // happen once ExtraDynamicSearcher has wired its pool. SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "RemotePostingOps: no job submitter wired; running BatchAppend synchronously\n"); std::shared_lock cbLock(m_callbackLifetimeMutex); @@ -853,30 +954,28 @@ namespace SPTAG::SPANN { } (r == ErrorCode::Success ? *successCount : *failCount).fetch_add(1); } - SendBatchAppendResponse(*packetPtr, successCount->load(), failCount->load()); + if (sendResponse && ackPacket) { + SendBatchAppendResponse(*ackPacket, successCount->load(), failCount->load()); + } + if (!sendResponse && batchID != 0) { + auto w = GetBatchAppendWAL(); + if (w) w->Delete(batchID); + } return; } for (size_t i = 0; i < total; i++) { auto* job = new BatchAppendItemJob( - this, batchReq, i, remaining, successCount, failCount, packetPtr); - // Route to the per-layer searcher pool matching this item's - // m_layer so local Append/Split/Merge on layer N and remote - // appends targeting layer N share the same 16-thread budget. - // A single global submitter sent both layers' work into one - // pool, causing 35k+ queue depth on the receiver side. + this, batchReq, i, remaining, successCount, failCount, + ackPacket, sendResponse, batchID); int layer = batchReq->m_items[i].m_layer; const JobSubmitter* sub = nullptr; if (layer >= 0 && static_cast(layer) < m_jobSubmitters.size() && m_jobSubmitters[layer]) { sub = &m_jobSubmitters[layer]; } else { - // Layer's pool not yet wired — fall back to whichever - // submitter we have. for (auto& s : m_jobSubmitters) { if (s) { sub = &s; break; } } } - // Per-layer routing (m_jobSubmitters[layer]) isolates layer-N - // append items from other layers' pools. if (sub) (*sub)(job); else { delete job; failCount->fetch_add(1); remaining->fetch_sub(1); } } @@ -1342,12 +1441,16 @@ namespace SPTAG::SPANN { std::shared_ptr> remaining, std::shared_ptr> successCount, std::shared_ptr> failCount, - std::shared_ptr replyPacket) + std::shared_ptr replyPacket, + bool sendResponse = true, + std::uint64_t batchID = 0) : m_ops(ops), m_batchReq(std::move(batchReq)), m_index(index), m_remaining(std::move(remaining)), m_success(std::move(successCount)), m_fail(std::move(failCount)), - m_replyPacket(std::move(replyPacket)) {} + m_replyPacket(std::move(replyPacket)), + m_sendResponse(sendResponse), + m_batchID(batchID) {} void exec(IAbortOperation*) override { run(); } void exec(void* workspace, IAbortOperation*) override { @@ -1372,8 +1475,16 @@ namespace SPTAG::SPANN { else m_fail->fetch_add(1); } if (m_remaining->fetch_sub(1) == 1) { - m_ops->SendBatchAppendResponse( - *m_replyPacket, m_success->load(), m_fail->load()); + if (m_sendResponse && m_replyPacket) { + m_ops->SendBatchAppendResponse( + *m_replyPacket, m_success->load(), m_fail->load()); + } else if (m_batchID != 0) { + // WAL path: sender already ACKed at WAL Put time. + // Best-effort delete; recovery scan would harmlessly + // re-apply (Append callback is idempotent). + auto wal = m_ops->GetBatchAppendWAL(); + if (wal) wal->Delete(m_batchID); + } } } @@ -1384,6 +1495,8 @@ namespace SPTAG::SPANN { std::shared_ptr> m_success; std::shared_ptr> m_fail; std::shared_ptr m_replyPacket; + bool m_sendResponse; + std::uint64_t m_batchID; }; // [Bug 26 retired] bg executor removed — see HandleBatchAppendRequest. @@ -1391,6 +1504,16 @@ namespace SPTAG::SPANN { // searcher's shared SPDKThreadPool via m_jobSubmitters[layer]. std::vector m_jobSubmitters; + // Receiver-side durable Batch WAL: when set, BatchAppendRequest is + // persisted before sender ACK so the receiver can process items + // asynchronously without losing them across a crash. + std::shared_ptr m_batchAppendWAL; + // Monotonic batchID counter (receiver-allocated). Persisted only + // implicitly via the WAL keys themselves; on startup recovery we + // bump past the maximum recovered batchID so live batches don't + // collide with replayed ones. + std::atomic m_nextBatchID{1}; + // HeadSync delivery diagnostics + retry queue (v33). Counters give // observability for sender/receiver gaps; per-peer backlogs + // retry thread make broadcast reliable best-effort. diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index e18c9557d..2f10402fb 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -119,6 +119,14 @@ namespace SPTAG::SPANN { void SetJobSubmitter(int layer, RemotePostingOps::JobSubmitter s) { m_remoteOps.SetJobSubmitter(layer, std::move(s)); } + // Wire the receiver-side durable Batch WAL. See RemotePostingOps + // for semantics. Pass a null pointer to disable. + void SetBatchAppendWAL(std::shared_ptr wal) { + m_remoteOps.SetBatchAppendWAL(std::move(wal)); + } + void RecoverPendingBatchAppendWAL() { + m_remoteOps.RecoverPendingBatches(); + } /// Atomically clear all RPC callbacks (every layer) and wait for any /// in-flight invocation to finish. void ClearCallbacks() { diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 44d3d63c9..2540a2d57 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -23,6 +23,7 @@ #include "Distributed/RemoteLeaseTable.h" #include "Distributed/HeadSyncLog.h" #include "Distributed/SplitWAL.h" +#include "Distributed/BatchAppendWAL.h" #include #include #include @@ -287,6 +288,12 @@ namespace SPTAG::SPANN { // Distributed/HeadSyncLog.h and Distributed/SplitWAL.h. std::unique_ptr m_headSyncLog; std::unique_ptr m_splitWAL; + // Receiver-side Batch WAL for cross-owner BatchAppend (Option A). + // Owned by each layer's searcher but the same TiKV cluster, keyed + // by receiver node index; layer-0 is the only owner that wires it + // into the WorkerNode (only one WAL per receiver, regardless of + // how many layers exist). + std::shared_ptr m_batchAppendWAL; std::atomic m_splitJobIdCounter{ 0 }; IndexStats m_stat; @@ -521,6 +528,13 @@ namespace SPTAG::SPANN { if (m_layer == 0) { m_headSyncLog = std::make_unique( db, m_worker->GetWorkerNodeIndex()); + // Receiver-side Batch WAL is per-receiver, not per-layer. + // Layer-0 owns the install; recovered entries route to + // their original layer via the m_layer field in each + // RemoteAppendRequest. + m_batchAppendWAL = std::make_shared( + db, m_worker->GetWorkerNodeIndex()); + m_worker->SetBatchAppendWAL(m_batchAppendWAL); } m_splitWAL = std::make_unique(db, m_layer); } @@ -649,6 +663,16 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "WorkerNode bound to ExtraDynamicSearcher (layer %d)\n", m_layer); + + // Layer-0 owns the Batch-Append WAL recovery: the append + // callback is now installed and m_jobSubmitters[0] is wired, + // so it is safe to replay any pending batches durably accepted + // before a previous crash. Recovered items route to their + // original layer via the m_layer field; if layer-1's submitter + // is not wired yet they fall back to layer-0's pool. + if (m_layer == 0 && m_batchAppendWAL) { + m_worker->RecoverPendingBatchAppendWAL(); + } } // Owner-side wait for any in-flight remote lock on this bucket. @@ -3723,19 +3747,13 @@ namespace SPTAG::SPANN { avgSplitMs, maxSplitMs); } if (runningJobs == 0 && totalJobs == 0) { - // Hold ALL DONE until the outbound remote-append queue and - // any in-flight chunks have also drained. Otherwise users - // see "ALL DONE" while the network pump is still shipping - // millions of fanned-out items to peers (see ReplicaCount=8 - // amplification path), giving a misleading "stuck" feel. - size_t remoteQ = 0; int remoteInflight = 0; - if (m_worker) { - remoteQ = m_worker->GetRemoteQueueSize(); - remoteInflight = m_worker->GetInflightAppendFlushes(); - } - if (remoteQ != 0 || remoteInflight != 0) { - return false; - } + // Note: AllFinished() must return true once the LOCAL pool + // is drained; SaveIndexData uses it as the shutdown signal. + // We can't gate it on the outbound remote-append queue: + // peers may continue routing reassigns back to us during + // the drain (feedback loop) so the queue is not + // guaranteed to hit zero. Remote queue depth shows up + // in the periodic progress log instead. if (!m_allDonePrinted) { size_t totalSplit = m_totalSplitSubmitted.load(); size_t totalMerge = m_totalMergeSubmitted.load(); diff --git a/AnnService/inc/Core/SPANN/ExtraTiKVController.h b/AnnService/inc/Core/SPANN/ExtraTiKVController.h index 0541eaad1..6b1ecf2fb 100644 --- a/AnnService/inc/Core/SPANN/ExtraTiKVController.h +++ b/AnnService/inc/Core/SPANN/ExtraTiKVController.h @@ -1378,6 +1378,93 @@ namespace SPTAG::SPANN return MultiDeletePrefixed(prefixedKeys, timeout); } + // ScanPrefix: walks `prefix` using paged RawScan and returns logical + // (key, value) pairs with the TiKVIO physical prefix stripped off. + // Used by durable WALs (e.g. BatchAppendWAL) to recover entries + // persisted before a crash. + ErrorCode ScanPrefix(const std::string& prefix, + std::vector>& out, + std::size_t maxEntries) override + { + const auto timeout = std::chrono::microseconds(5'000'000); + std::string physicalPrefix = MakePrefixedKey(prefix); + // RawScan end_key: a key strictly greater than every key in the + // prefix. Increment last byte; if it overflows append 0xff. + std::string endKey = physicalPrefix; + while (!endKey.empty() && static_cast(endKey.back()) == 0xFF) { + endKey.pop_back(); + } + if (endKey.empty()) { + endKey = physicalPrefix + std::string(1, '\xFF'); + } else { + endKey.back() = static_cast(static_cast(endKey.back()) + 1); + } + + std::string cursor = physicalPrefix; + const int pageLimit = 1024; + for (;;) { + int attempt = 0; + bool advanced = false; + std::string lastKey; + int count = 0; + for (; attempt < 10; attempt++) { + auto stub = GetStubForKey(cursor); + if (!stub) { RetryBackoff(attempt); continue; } + + kvrpcpb::RawScanRequest request; + request.set_start_key(cursor); + request.set_end_key(endKey); + request.set_limit(pageLimit); + SetContext(request.mutable_context(), cursor); + + kvrpcpb::RawScanResponse response; + grpc::ClientContext ctx; + SetDeadline(ctx, timeout); + + auto status = stub->RawScan(&ctx, request, &response); + if (!status.ok()) { + if (ShouldLogRetry(attempt)) + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "TiKVIO::ScanPrefix gRPC error (attempt %d): %s\n", + attempt + 1, status.error_message().c_str()); + InvalidateRegionCache(cursor); + RetryBackoff(attempt); + continue; + } + if (response.has_region_error()) { + InvalidateRegionCache(cursor); + RetryBackoff(attempt); + continue; + } + count = response.kvs_size(); + for (int i = 0; i < count; i++) { + const auto& kv = response.kvs(i); + const std::string& k = kv.key(); + if (k.size() < physicalPrefix.size()) continue; + out.emplace_back(k.substr(physicalPrefix.size() - prefix.size()), kv.value()); + if (maxEntries > 0 && out.size() >= maxEntries) { + return ErrorCode::Success; + } + } + if (count > 0) { + lastKey = response.kvs(count - 1).key(); + advanced = true; + } + break; + } + if (attempt >= 10) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "TiKVIO::ScanPrefix exhausted retries\n"); + return ErrorCode::Fail; + } + if (!advanced || count < pageLimit) { + return ErrorCode::Success; + } + // Advance cursor past the last seen key. + cursor = lastKey + std::string(1, '\0'); + } + } + // Variants that accept already-prefixed keys (used by chunk/count helpers // that produce keys via MakeChunkKey / MakeCountKey). ErrorCode MultiPutPrefixed(const std::vector& prefixedKeys, diff --git a/AnnService/inc/Helper/KeyValueIO.h b/AnnService/inc/Helper/KeyValueIO.h index 9d7c1e2a3..bbd7262aa 100644 --- a/AnnService/inc/Helper/KeyValueIO.h +++ b/AnnService/inc/Helper/KeyValueIO.h @@ -95,6 +95,19 @@ namespace SPTAG virtual ErrorCode NextToScan(SizeType& key, std::string* value) {return ErrorCode::Undefined;} + // ScanPrefix: enumerate all (logical key, value) pairs in the + // store whose logical key starts with `prefix`. Implementations + // that prepend their own physical key prefix are expected to + // strip it before returning keys. `maxEntries` caps the result + // size (0 = no cap). Default no-op so non-distributed backends + // don't need to implement it. + virtual ErrorCode ScanPrefix(const std::string& prefix, + std::vector>& out, + std::size_t maxEntries = 0) { + (void)prefix; (void)out; (void)maxEntries; + return ErrorCode::Undefined; + } + virtual void LogAsyncWaitStatsAndReset(int layer) {} }; } From 7aca9f005b2710e8eb9c1ebcae12ede15cf032d2 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Thu, 21 May 2026 14:55:59 +0000 Subject: [PATCH 26/51] fix(distributed): receiver-side admission control for Batch WAL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After enabling the WAL-then-ACK fast path, an aggressive sender could ACK 1M items in seconds while the receiver's apply pool was still working through the first 10k — pending queue grew unbounded (1M+), splits starved because pool workers were all blocked on appends. Add admission control: RemotePostingOps counts items currently queued for async apply via m_walPendingItems. When admitting a new batch would push that above m_walPendingItemsCap (default 50000) we DELIBERATELY fall back to the synchronous-ACK path, which re-engages the sender's MaxInflight gate as a natural backpressure mechanism. Also surface m_walPendingItems in the per-layer progress log ('walPendingItems:N') so operators can see when admission control is actively engaged. Verified 2-node insert_dominant 1M+1M: insert throughput 710→770/s (+8.5%), recall@5 0.976→0.984, post-insert qps 401→438. Pending queue stays bounded at ~80-130k under load; splits make steady progress. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemotePostingOps.h | 58 +++++++++++++++++-- .../inc/Core/SPANN/Distributed/WorkerNode.h | 6 ++ .../inc/Core/SPANN/ExtraDynamicSearcher.h | 6 +- 3 files changed, 63 insertions(+), 7 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 88b2478a7..87c1ea87f 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -887,23 +887,33 @@ namespace SPTAG::SPANN { // asynchronously. If WAL writes fail we fall through to the // legacy synchronous-ACK path so the sender still sees an // honest success/fail count. + // + // Admission control: when the receiver already has more than + // `m_walPendingItemsCap` items queued for asynchronous apply, + // we DELIBERATELY take the legacy synchronous-ACK path even + // though the WAL is wired. That re-engages the natural + // backpressure (sender's MaxInflight blocks until current + // chunks ACK), preventing unbounded pool queue growth on the + // receiver under sustained load. Without this, a fast sender + // could ACK 1M items in seconds while the apply pool is still + // working through the first 10k. std::shared_ptr wal; { std::shared_lock lk(m_callbackLifetimeMutex); wal = m_batchAppendWAL; } - if (wal && wal->Enabled() && !m_jobSubmitters.empty()) { + const std::size_t pendingNow = m_walPendingItems.load(std::memory_order_relaxed); + const std::size_t cap = m_walPendingItemsCap.load(std::memory_order_relaxed); + const bool overCap = (cap > 0 && pendingNow + total > cap); + if (wal && wal->Enabled() && !m_jobSubmitters.empty() && !overCap) { std::uint64_t batchID = m_nextBatchID.fetch_add(1, std::memory_order_relaxed); - // Re-encode rather than reuse the inbound packet body to - // avoid pinning the receive buffer for the lifetime of the - // batch. std::string blob; blob.resize(batchReq->EstimateBufferSize()); auto* end = batchReq->Write(reinterpret_cast(&blob[0])); blob.resize(static_cast( end - reinterpret_cast(blob.data()))); if (wal->Put(batchID, blob)) { - // Durable — ACK immediately as Accepted (success=total). + m_walPendingItems.fetch_add(total, std::memory_order_relaxed); SendBatchAppendResponse(packet, static_cast(total), 0); SubmitBatchItems(batchReq, batchID, @@ -914,6 +924,14 @@ namespace SPTAG::SPANN { "RemotePostingOps: BatchAppendWAL Put failed batchID=%llu — " "falling back to synchronous ACK\n", (unsigned long long)batchID); + } else if (overCap) { + static std::atomic sLogCounter{0}; + if ((sLogCounter.fetch_add(1) % 256) == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "RemotePostingOps: BatchAppendWAL admission-control engaged " + "(pending=%zu+%zu > cap=%zu) — using synchronous ACK\n", + pendingNow, total, cap); + } } // Legacy / fallback path: process items inline-or-async, ACK on @@ -1484,6 +1502,7 @@ namespace SPTAG::SPANN { // re-apply (Append callback is idempotent). auto wal = m_ops->GetBatchAppendWAL(); if (wal) wal->Delete(m_batchID); + m_ops->NoteWalPendingItemsDrained(m_batchReq->m_items.size()); } } } @@ -1513,6 +1532,35 @@ namespace SPTAG::SPANN { // bump past the maximum recovered batchID so live batches don't // collide with replayed ones. std::atomic m_nextBatchID{1}; + // Admission control for the WAL-backed path. When the sum of items + // already queued for asynchronous apply plus the incoming batch + // would exceed `m_walPendingItemsCap`, HandleBatchAppendRequest + // falls back to the synchronous-ACK path so the sender's + // MaxInflight gate naturally backpressures further chunks. Cap of + // 0 disables admission control (always WAL when wired). Default is + // ~ChunkSize * MaxInflightPerNode * NumPeers, chosen to absorb one + // round-trip's worth of items without unbounded queue growth. + std::atomic m_walPendingItems{0}; + std::atomic m_walPendingItemsCap{50000}; + + public: + void NoteWalPendingItemsDrained(std::size_t n) { + if (n == 0) return; + std::size_t prev = m_walPendingItems.fetch_sub(n, std::memory_order_relaxed); + if (prev < n) { + // Saturating clamp (defensive: should never happen because + // every increment in HandleBatchAppendRequest is paired + // with exactly one decrement in BatchAppendItemJob). + m_walPendingItems.store(0, std::memory_order_relaxed); + } + } + void SetBatchAppendWalPendingItemsCap(std::size_t cap) { + m_walPendingItemsCap.store(cap, std::memory_order_relaxed); + } + std::size_t GetBatchAppendWalPendingItems() const { + return m_walPendingItems.load(std::memory_order_relaxed); + } + private: // HeadSync delivery diagnostics + retry queue (v33). Counters give // observability for sender/receiver gaps; per-peer backlogs + diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index 2f10402fb..7597f6955 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -127,6 +127,12 @@ namespace SPTAG::SPANN { void RecoverPendingBatchAppendWAL() { m_remoteOps.RecoverPendingBatches(); } + void SetBatchAppendWalPendingItemsCap(std::size_t cap) { + m_remoteOps.SetBatchAppendWalPendingItemsCap(cap); + } + std::size_t GetBatchAppendWalPendingItems() const { + return m_remoteOps.GetBatchAppendWalPendingItems(); + } /// Atomically clear all RPC callbacks (every layer) and wait for any /// in-flight invocation to finish. void ClearCallbacks() { diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 2540a2d57..b56e10812 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -3728,22 +3728,24 @@ namespace SPTAG::SPANN { // stay quiet. size_t remoteQ = 0, remoteTotal = 0; int remoteInflight = 0; + std::size_t walPending = 0; if (m_worker) { remoteQ = m_worker->GetRemoteQueueSize(); remoteTotal = m_worker->GetTotalRemoteAppendsRouted(); remoteInflight = m_worker->GetInflightAppendFlushes(); + walPending = m_worker->GetBatchAppendWalPendingItems(); } SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "layer %d pending queue:%zu split:%zu merge:%zu append:%zu reassign:%zu running:%u | " "total_submitted split:%zu merge:%zu reassign:%zu append:%zu | " "total_completed split:%zu merge:%zu reassign:%zu | " - "remote queueDepth:%zu inflightChunks:%d totalRouted:%zu | " + "remote queueDepth:%zu inflightChunks:%d totalRouted:%zu walPendingItems:%zu | " "split_latency avg:%.1fms max:%.1fms\n", m_layer, totalJobs, m_splitJobsInFlight.load(), m_mergeJobsInFlight.load(), m_appendJobsInFlight.load(), m_reassignJobsInFlight.load(), runningJobs, m_totalSplitSubmitted.load(), m_totalMergeSubmitted.load(), m_totalReassignSubmitted.load(), m_totalAppendCount.load(), m_totalSplitCompleted.load(), m_totalMergeCompleted.load(), m_totalReassignCompleted.load(), - remoteQ, remoteInflight, remoteTotal, + remoteQ, remoteInflight, remoteTotal, walPending, avgSplitMs, maxSplitMs); } if (runningJobs == 0 && totalJobs == 0) { From 2088e136feb19a91fd59c8c6f9a4c9db1d5078bc Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Fri, 22 May 2026 05:43:05 +0000 Subject: [PATCH 27/51] fix(distributed): stop replaying moved-out items + per-layer remote-origin pending gauge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug fix ------- SendBatchRemoteAppend moves items[i] into per-chunk std::vector and calls SendBatchRemoteAppendChunk. If a chunk failed (e.g. timeout) the function returned without restoring the moved-out items, so the caller's vector ended up with the leading chunks moved-from (headID + appendNum scalars still valid, but m_headVec / m_appendPosting empty). WorkerNode::QueueRemoteAppend's auto-flush path then copied the whole vector into a watchdog retry queue, which re-sent valid headIDs with empty postings. The receiver hit the TiKVIO::Merge empty-value gate, logged 'TiKVIO::Merge: empty append posting!' and 'Merge failed for HEAD! Posting Size:0' for every such phantom item — in a 2-node insert_dominant run we observed 390k+ such errors on the driver and 60k on the worker. Fix: - SendBatchRemoteAppend now (a) restores moved-out items from the still-populated chunk on failure, then erases the already-sent prefix so the caller-side retry only sees unsent payload, and (b) clears the input vector on full success so any spurious retry becomes a no-op instead of resurrecting phantom items. - Append() drops empty/zero-count payloads with a single warning rather than letting them reach the storage layer (defensive guard; receiver should never see these once the sender bug above is fixed). Observability ------------- Added a per-layer counter m_remoteOriginPending in RemotePostingOps, incremented in SubmitBatchItems and decremented in BatchAppendItemJob. Exposed via WorkerNode::GetRemoteOriginPendingItems(layer) and a whole-node aggregate. The progress log in ExtraDynamicSearcher now prints 'pending queue:N (local:X remote:Y)' so operators can tell whether the local pool is bottlenecked on its own RMWs/splits or on serving peer BatchAppend items. Both progress log call sites (AllFinished's periodic line and GetDBStats's on-demand line) updated to the same format with the remote out queueDepth / inflightChunks / walPendingItems context. Verified on 2-node insert_dominant: 0 empty-posting / merge-failed errors (was 450k), throughput 758-797/s (within noise of 710 baseline and 770 WAL run), recall 0.984-0.990. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemotePostingOps.h | 85 ++++++++++++++++--- .../inc/Core/SPANN/Distributed/WorkerNode.h | 6 ++ .../inc/Core/SPANN/ExtraDynamicSearcher.h | 58 ++++++++++--- 3 files changed, 127 insertions(+), 22 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 87c1ea87f..5be825651 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -389,16 +389,15 @@ namespace SPTAG::SPANN { // RemoteAppendChunkSize (default 3000). const size_t kChunkSize = std::max(1, (size_t)m_rpcChunkSize.load(std::memory_order_relaxed)); - const size_t total = items.size(); - size_t offset = 0; + size_t kept = 0; std::vector chunk; - chunk.reserve(std::min(kChunkSize, total)); + chunk.reserve(std::min(kChunkSize, items.size())); - while (offset < total) { - size_t end = std::min(offset + kChunkSize, total); + while (kept < items.size()) { + size_t end = std::min(kept + kChunkSize, items.size()); chunk.clear(); - chunk.reserve(end - offset); - for (size_t i = offset; i < end; ++i) { + chunk.reserve(end - kept); + for (size_t i = kept; i < end; ++i) { chunk.push_back(std::move(items[i])); } @@ -406,11 +405,28 @@ namespace SPTAG::SPANN { if (chunkRet != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "RemotePostingOps: Chunk send failed to node %d (offset=%zu/%zu, chunk=%zu items)\n", - targetNodeIndex, offset, total, end - offset); + targetNodeIndex, kept, items.size(), end - kept); + // Restore the moved-out items in [kept..end) from the + // still-populated chunk, then drop the already-sent + // prefix [0..kept) so retrying the caller sees only + // the unsent payload. Without this compaction, the + // auto-flush watchdog would resend already-successful + // items whose m_appendPosting/m_headVec strings are + // now empty (moved-out), and the receiver would log + // "empty append posting!" for each such phantom item. + for (size_t i = 0; i < chunk.size() && (kept + i) < items.size(); ++i) { + items[kept + i] = std::move(chunk[i]); + } + if (kept > 0) { + items.erase(items.begin(), items.begin() + kept); + } return chunkRet; } - offset = end; + kept = end; } + // All chunks sent successfully — fully drain the input so any + // caller-side retry sees an empty vector. + items.clear(); return ErrorCode::Success; } @@ -994,7 +1010,10 @@ namespace SPTAG::SPANN { } else { for (auto& s : m_jobSubmitters) { if (s) { sub = &s; break; } } } - if (sub) (*sub)(job); + if (sub) { + RemoteOriginPendingSlot(layer).fetch_add(1, std::memory_order_relaxed); + (*sub)(job); + } else { delete job; failCount->fetch_add(1); remaining->fetch_sub(1); } } } @@ -1492,6 +1511,14 @@ namespace SPTAG::SPANN { if (r == ErrorCode::Success) m_success->fetch_add(1); else m_fail->fetch_add(1); } + // Decrement per-layer remote-origin pool gauge for every + // completed item (paired with increment in SubmitBatchItems). + { + int layer = m_batchReq->m_items[m_index].m_layer; + auto& slot = m_ops->RemoteOriginPendingSlot(layer); + std::size_t prev = slot.fetch_sub(1, std::memory_order_relaxed); + if (prev == 0) slot.store(0, std::memory_order_relaxed); // saturating + } if (m_remaining->fetch_sub(1) == 1) { if (m_sendResponse && m_replyPacket) { m_ops->SendBatchAppendResponse( @@ -1543,7 +1570,45 @@ namespace SPTAG::SPANN { std::atomic m_walPendingItems{0}; std::atomic m_walPendingItemsCap{50000}; + // Per-layer count of items submitted to the local job pool that + // originated from a peer's BatchAppend RPC (covers BOTH the + // WAL-backed and legacy synchronous-ACK paths). Lets the periodic + // progress log split "pending queue" into local-origin RMWs vs + // remote-origin items so operators can tell whether the receiver + // is bottlenecked on its own inserts or on serving peers. Indexed + // by req.m_layer; sized lazily to max observed layer + 1. + mutable std::mutex m_remoteOriginPendingMutex; + std::vector> m_remoteOriginPending; + + std::atomic& RemoteOriginPendingSlot(int layer) { + if (layer < 0) layer = 0; + { + std::lock_guard g(m_remoteOriginPendingMutex); + if (static_cast(layer) >= m_remoteOriginPending.size()) { + std::vector> grown(layer + 1); + for (std::size_t i = 0; i < m_remoteOriginPending.size(); ++i) { + grown[i].store(m_remoteOriginPending[i].load(std::memory_order_relaxed), + std::memory_order_relaxed); + } + m_remoteOriginPending = std::move(grown); + } + } + return m_remoteOriginPending[layer]; + } + public: + std::size_t GetRemoteOriginPendingItems(int layer) const { + std::lock_guard g(m_remoteOriginPendingMutex); + if (layer < 0 || static_cast(layer) >= m_remoteOriginPending.size()) return 0; + return m_remoteOriginPending[layer].load(std::memory_order_relaxed); + } + // Aggregate across all layers (whole-node view). + std::size_t GetRemoteOriginPendingItems() const { + std::lock_guard g(m_remoteOriginPendingMutex); + std::size_t sum = 0; + for (auto& a : m_remoteOriginPending) sum += a.load(std::memory_order_relaxed); + return sum; + } void NoteWalPendingItemsDrained(std::size_t n) { if (n == 0) return; std::size_t prev = m_walPendingItems.fetch_sub(n, std::memory_order_relaxed); diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index 7597f6955..b8fa36998 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -133,6 +133,12 @@ namespace SPTAG::SPANN { std::size_t GetBatchAppendWalPendingItems() const { return m_remoteOps.GetBatchAppendWalPendingItems(); } + std::size_t GetRemoteOriginPendingItems() const { + return m_remoteOps.GetRemoteOriginPendingItems(); + } + std::size_t GetRemoteOriginPendingItems(int layer) const { + return m_remoteOps.GetRemoteOriginPendingItems(layer); + } /// Atomically clear all RPC callbacks (every layer) and wait for any /// in-flight invocation to finish. void ClearCallbacks() { diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index b56e10812..c5d074afd 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -2289,12 +2289,19 @@ namespace SPTAG::SPANN { ErrorCode Append(ExtraWorkSpace* p_exWorkSpace, SizeType headID, int appendNum, std::string& appendPosting, int reassignThreshold = 0) { auto appendBegin = std::chrono::high_resolution_clock::now(); - if (appendPosting.empty()) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Error! empty append posting!\n"); - } - - if (appendNum == 0) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Error!, headID :%lld, appendNum:%d\n", (std::int64_t)headID, appendNum); + if (appendPosting.empty() || appendNum == 0) { + // Defensive: drop empty/zero-count appends rather than letting + // them reach the storage layer (which would log + // "TiKVIO::Merge: empty append posting!" and fail). Empty + // payloads should never be produced by normal flow, but they + // can arise from buggy sender-side retries that resend + // already-consumed (moved-from) items. + if (appendPosting.empty() && appendNum != 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Append: dropping empty posting for headID=%lld appendNum=%d\n", + (std::int64_t)headID, appendNum); + } + return ErrorCode::Success; } // If this head is owned by a remote node, route the append via @@ -3729,19 +3736,30 @@ namespace SPTAG::SPANN { size_t remoteQ = 0, remoteTotal = 0; int remoteInflight = 0; std::size_t walPending = 0; + std::size_t remoteOriginPending = 0; if (m_worker) { remoteQ = m_worker->GetRemoteQueueSize(); remoteTotal = m_worker->GetTotalRemoteAppendsRouted(); remoteInflight = m_worker->GetInflightAppendFlushes(); walPending = m_worker->GetBatchAppendWalPendingItems(); - } + remoteOriginPending = m_worker->GetRemoteOriginPendingItems(m_layer); + } + // Split the local pool's pending queue into the portion + // serving peer-originated BatchAppend items vs the residual + // (local-origin RMWs, split/merge/reassign jobs). Helps + // operators distinguish "I'm bottlenecked applying remote + // work" from "my own inserts are backlogged". + size_t localPending = totalJobs > remoteOriginPending + ? totalJobs - remoteOriginPending + : 0; SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "layer %d pending queue:%zu split:%zu merge:%zu append:%zu reassign:%zu running:%u | " + "layer %d pending queue:%zu (local:%zu remote:%zu) split:%zu merge:%zu append:%zu reassign:%zu running:%u | " "total_submitted split:%zu merge:%zu reassign:%zu append:%zu | " "total_completed split:%zu merge:%zu reassign:%zu | " - "remote queueDepth:%zu inflightChunks:%d totalRouted:%zu walPendingItems:%zu | " + "remote out queueDepth:%zu inflightChunks:%d totalRouted:%zu walPendingItems:%zu | " "split_latency avg:%.1fms max:%.1fms\n", - m_layer, totalJobs, m_splitJobsInFlight.load(), + m_layer, totalJobs, localPending, remoteOriginPending, + m_splitJobsInFlight.load(), m_mergeJobsInFlight.load(), m_appendJobsInFlight.load(), m_reassignJobsInFlight.load(), runningJobs, m_totalSplitSubmitted.load(), m_totalMergeSubmitted.load(), m_totalReassignSubmitted.load(), m_totalAppendCount.load(), m_totalSplitCompleted.load(), m_totalMergeCompleted.load(), m_totalReassignCompleted.load(), @@ -3862,17 +3880,33 @@ namespace SPTAG::SPANN { double avgSplitMs = completedSplit > 0 ? (m_totalSplitTimeUs.load() / 1000.0 / completedSplit) : 0; double maxSplitMs = m_maxSplitTimeUs.load() / 1000.0; size_t totalJobs = m_splitThreadPool ? m_splitThreadPool->jobsize() : 0; + size_t remoteQ = 0, remoteTotal = 0; + int remoteInflight = 0; + std::size_t walPending = 0; + std::size_t remoteOriginPending = 0; + if (m_worker) { + remoteQ = m_worker->GetRemoteQueueSize(); + remoteTotal = m_worker->GetTotalRemoteAppendsRouted(); + remoteInflight = m_worker->GetInflightAppendFlushes(); + walPending = m_worker->GetBatchAppendWalPendingItems(); + remoteOriginPending = m_worker->GetRemoteOriginPendingItems(m_layer); + } + size_t localPending = totalJobs > remoteOriginPending + ? totalJobs - remoteOriginPending + : 0; // if (!ShouldLogProgress(totalJobs)) return; SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "layer %d pending queue:%zu split:%zu merge:%zu append:%zu reassign:%zu running:%u | " + "layer %d pending queue:%zu (local:%zu remote:%zu) split:%zu merge:%zu append:%zu reassign:%zu running:%u | " "total_submitted split:%zu merge:%zu reassign:%zu append:%zu | " "total_completed split:%zu merge:%zu reassign:%zu | " + "remote out queueDepth:%zu inflightChunks:%d totalRouted:%zu walPendingItems:%zu | " "split_latency avg:%.1fms max:%.1fms\n", - m_layer, totalJobs, + m_layer, totalJobs, localPending, remoteOriginPending, m_splitJobsInFlight.load(), m_mergeJobsInFlight.load(), m_appendJobsInFlight.load(), m_reassignJobsInFlight.load(), m_splitThreadPool ? static_cast(m_splitThreadPool->runningJobs()) : 0, m_totalSplitSubmitted.load(), m_totalMergeSubmitted.load(), m_totalReassignSubmitted.load(), m_totalAppendCount.load(), m_totalSplitCompleted.load(), m_totalMergeCompleted.load(), m_totalReassignCompleted.load(), + remoteQ, remoteInflight, remoteTotal, walPending, avgSplitMs, maxSplitMs); } From 3107dbcf65e8520151784f5ce73e0e993ba57114 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Fri, 22 May 2026 06:25:03 +0000 Subject: [PATCH 28/51] feat(distributed): classify async-job errors + exponential backoff retry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Background ---------- MergeAsyncJob and SplitAsyncJob previously retried every non-Success ErrorCode in a tight loop (re-enqueueing immediately on the same pool worker), capped at AsyncJobMaxRetry=3. This wasted pool slots on permanent failures (e.g. logical data inconsistencies that no retry can repair) and gave transient TiKV failures only ~no time to recover before exhausting the retry budget. Changes ------- - Add Distributed/DelayedJobScheduler.h: a single-threaded helper that re-enqueues ThreadPool::Job pointers to a target pool after a per-call delay. Owns pending jobs between Schedule() and dispatch; destructor joins the worker and deletes any undispatched jobs to avoid leaks on shutdown. Holds the target pool via shared_ptr so the scheduler can survive teardown ordering. - Add IsTransientAsyncJobError(ret) classifier. Transient: Fail, DiskIOFail, EmptyDiskIO, Socket_*. Permanent: everything else (Key_NotFound, Posting_*, Block_IDError, etc.). ErrorCode::Fail is intentionally transient because every TiKV failure path returns it; the rare logical-Fail callers (e.g. headVec-missing in MergePostings) pay a bounded number of wasted retries which is acceptable until a more specific code is introduced. - Add AsyncJobRetryBackoffMs(attempt): exponential backoff (200ms doubling, capped at 30s). - MergeAsyncJob and SplitAsyncJob now: * On transient + retry budget remaining → re-enqueue via the DelayedJobScheduler with exponential backoff (off the pool worker so we do not block a job slot during the wait). * On permanent → log Warning once, drop, do NOT poison m_asyncStatus (these are typically per-head local inconsistencies that the next caller-driven recovery handles, and surfacing them as process-wide failure was hiding real transient issues). * On transient with budget exhausted → keep the existing behaviour of setting m_asyncStatus + LL_Error, so a persistent outage still bubbles up. - Bump AsyncJobMaxRetry default 3 -> 8. With the new backoff schedule this gives ~25s total retry budget per job (200+400+800+1600+3200+ 6400+12800ms), enough to ride out a short TiKV region rebalance or network blip without the operator needing to override the config. The scheduler is lazily constructed on first retry, so single-node / build-only paths that never exercise async retries do not pay for an extra background thread. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../SPANN/Distributed/DelayedJobScheduler.h | 169 ++++++++++++++++++ .../inc/Core/SPANN/ExtraDynamicSearcher.h | 99 +++++++--- .../inc/Core/SPANN/ParameterDefinitionList.h | 2 +- 3 files changed, 244 insertions(+), 26 deletions(-) create mode 100644 AnnService/inc/Core/SPANN/Distributed/DelayedJobScheduler.h diff --git a/AnnService/inc/Core/SPANN/Distributed/DelayedJobScheduler.h b/AnnService/inc/Core/SPANN/Distributed/DelayedJobScheduler.h new file mode 100644 index 000000000..9661439fd --- /dev/null +++ b/AnnService/inc/Core/SPANN/Distributed/DelayedJobScheduler.h @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#ifndef _SPTAG_SPANN_DISTRIBUTED_DELAYEDJOBSCHEDULER_H_ +#define _SPTAG_SPANN_DISTRIBUTED_DELAYEDJOBSCHEDULER_H_ + +#include "inc/Helper/Concurrent.h" +#include "inc/Helper/ThreadPool.h" +#include "inc/Helper/Logging.h" +#include "inc/Core/Common.h" + +#include +#include +#include +#include +#include +#include +#include + +namespace SPTAG { +namespace SPANN { +namespace Distributed { + +// DelayedJobScheduler runs a single worker thread that re-enqueues +// previously-failed ThreadPool jobs after an exponential backoff. It +// exists so async Merge/Split job retries can wait before retrying +// (instead of busy-spinning the pool worker) without blocking any actual +// pool slot during the wait. +// +// Jobs are owned by the scheduler between Schedule() and the moment they +// are transferred to the destination pool. If the scheduler is destroyed +// while jobs are still pending (e.g. process shutdown), the destructor +// drains the heap and deletes every undispatched job so the Helper:: +// ThreadPool::Job allocations do not leak. +// +// The destination pool is held via shared_ptr so the scheduler can survive +// teardown ordering — the pool stays alive as long as either the scheduler +// or the original owner still holds a reference. +class DelayedJobScheduler { +public: + DelayedJobScheduler() : m_stop(false) { + m_worker = std::thread([this] { Loop(); }); + } + + ~DelayedJobScheduler() { + { + std::lock_guard g(m_mu); + m_stop = true; + } + m_cv.notify_all(); + if (m_worker.joinable()) m_worker.join(); + std::lock_guard g(m_mu); + for (auto& e : m_heap) { + if (e.job) delete e.job; + } + m_heap.clear(); + } + + // Take ownership of `job` and add it to `pool` after `delayMs`. + // `pool` must be non-null; `job` must be non-null and not already + // queued anywhere. + void Schedule(std::shared_ptr pool, + Helper::ThreadPool::Job* job, int delayMs) { + if (!pool || !job) { if (job) delete job; return; } + Entry e; + e.deadline = std::chrono::steady_clock::now() + + std::chrono::milliseconds(delayMs); + e.pool = std::move(pool); + e.job = job; + { + std::lock_guard g(m_mu); + m_heap.push_back(std::move(e)); + std::push_heap(m_heap.begin(), m_heap.end(), Cmp{}); + } + m_cv.notify_all(); + } + + std::size_t Pending() const { + std::lock_guard g(m_mu); + return m_heap.size(); + } + +private: + struct Entry { + std::chrono::steady_clock::time_point deadline; + std::shared_ptr pool; + Helper::ThreadPool::Job* job = nullptr; + }; + struct Cmp { + bool operator()(const Entry& a, const Entry& b) const { + return a.deadline > b.deadline; + } + }; + + void Loop() { + std::unique_lock lk(m_mu); + while (!m_stop) { + if (m_heap.empty()) { + m_cv.wait(lk); + continue; + } + auto now = std::chrono::steady_clock::now(); + if (m_heap.front().deadline <= now) { + Entry e = std::move(m_heap.front()); + std::pop_heap(m_heap.begin(), m_heap.end(), Cmp{}); + m_heap.pop_back(); + lk.unlock(); + if (e.pool) { + e.pool->add(e.job); + } else if (e.job) { + delete e.job; + } + lk.lock(); + continue; + } + m_cv.wait_until(lk, m_heap.front().deadline); + } + } + + mutable std::mutex m_mu; + std::condition_variable m_cv; + std::vector m_heap; + bool m_stop; + std::thread m_worker; +}; + +// Classify an async-job failure into transient (retry with backoff) +// vs permanent (drop with warning). Transient codes capture TiKV / IO +// errors that should clear on a later attempt; permanent codes capture +// logical inconsistencies (e.g. a vector ID outside the version map, +// a posting whose serialized header is malformed) that no number of +// retries can repair. +// +// ErrorCode::Fail is intentionally classified transient: every TiKV +// failure path in ExtraTiKVController returns Fail, and the few logical +// callers that also return Fail (e.g. MergePostings when the head vector +// is missing from its own posting) are rare enough that a bounded number +// of wasted retries is acceptable. If a more specific ErrorCode value +// becomes available for the logical case, demote those returns there +// and remove Fail from the transient set. +inline bool IsTransientAsyncJobError(ErrorCode ret) { + switch (ret) { + case ErrorCode::Fail: + case ErrorCode::DiskIOFail: + case ErrorCode::EmptyDiskIO: + case ErrorCode::Socket_FailedConnectToEndPoint: + case ErrorCode::Socket_FailedResolveEndPoint: + return true; + default: + return false; + } +} + +// Exponential backoff with a cap. `attempt` is 0-based (0 = first retry). +inline int AsyncJobRetryBackoffMs(int attempt, + int initialMs = 200, + int capMs = 30000) { + if (attempt < 0) attempt = 0; + if (attempt > 20) attempt = 20; + long long delay = (long long)initialMs << attempt; + if (delay > capMs) delay = capMs; + return (int)delay; +} + +} // namespace Distributed +} // namespace SPANN +} // namespace SPTAG + +#endif // _SPTAG_SPANN_DISTRIBUTED_DELAYEDJOBSCHEDULER_H_ diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index c5d074afd..6f190f197 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -24,6 +24,7 @@ #include "Distributed/HeadSyncLog.h" #include "Distributed/SplitWAL.h" #include "Distributed/BatchAppendWAL.h" +#include "Distributed/DelayedJobScheduler.h" #include #include #include @@ -79,30 +80,54 @@ namespace SPTAG::SPANN { inline void exec(void* p_workSpace, IAbortOperation* p_abort) override { ErrorCode ret = m_extraIndex->MergePostings((ExtraWorkSpace*)p_workSpace, m_headID); if (ret != ErrorCode::Success) { + // Classify before retrying: transient errors (TiKV + // region_error, timeout, generic Fail from the IO + // layer) deserve a bounded retry with exponential + // backoff; permanent errors (data inconsistency, + // unknown ErrorCode) cannot be repaired by retry and + // get dropped with a warning so we don't burn + // pool slots in a hot fail loop. int maxRetry = m_extraIndex->m_opt ? m_extraIndex->m_opt->m_asyncJobMaxRetry : 0; - if (m_attempts + 1 < maxRetry) { + bool transient = Distributed::IsTransientAsyncJobError(ret); + if (transient && m_attempts + 1 < maxRetry) { // Async-job fault-tolerance contract: merges are // safe to retry idempotently (the owner check, the // ContainSample liveness gate, and the locked RMW // all re-evaluate on each attempt). Enqueue a - // fresh Job carrying the bumped attempt count — - // the ThreadPool worker will `delete` *this* after - // we return, so we cannot re-add the same pointer. - // Keep m_mergeJobsInFlight unchanged: the new job + // fresh Job carrying the bumped attempt count via + // the delayed-retry scheduler so backoff happens + // OFF the pool worker — the ThreadPool worker + // will `delete` *this* after we return, so we + // cannot re-add the same pointer. Keep + // m_mergeJobsInFlight unchanged: the new job // takes ownership of the in-flight slot. + int backoffMs = Distributed::AsyncJobRetryBackoffMs(m_attempts); SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "MergeAsyncJob: head=%lld attempt=%d failed ret=%d, re-enqueueing\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret); + "MergeAsyncJob: head=%lld attempt=%d failed ret=%d (transient), backoff=%dms\n", + (std::int64_t)m_headID, m_attempts + 1, (int)ret, backoffMs); auto* retryJob = new MergeAsyncJob(m_extraIndex, m_headID, m_callback); retryJob->m_attempts = m_attempts + 1; - m_extraIndex->m_splitThreadPool->add(retryJob); + m_extraIndex->GetOrCreateDelayedRetryScheduler().Schedule( + m_extraIndex->m_splitThreadPool, retryJob, backoffMs); return; } - m_extraIndex->m_asyncStatus = ret; - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "MergeAsyncJob: head=%lld giving up after %d attempts ret=%d\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret); + if (!transient) { + // Permanent: log once and drop. Do not promote to + // m_asyncStatus — these are usually local data + // inconsistencies (e.g. version skew) that the + // next caller-driven recovery will repair, and + // poisoning m_asyncStatus would surface them as + // a process-wide failure. + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergeAsyncJob: head=%lld permanent failure ret=%d, dropping\n", + (std::int64_t)m_headID, (int)ret); + } else { + m_extraIndex->m_asyncStatus = ret; + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "MergeAsyncJob: head=%lld giving up after %d attempts ret=%d (transient exhausted)\n", + (std::int64_t)m_headID, m_attempts + 1, (int)ret); + } } m_extraIndex->m_mergeJobsInFlight--; m_extraIndex->m_totalMergeCompleted++; @@ -136,26 +161,34 @@ namespace SPTAG::SPANN { uint64_t prevMax = m_extraIndex->m_maxSplitTimeUs.load(); while (elapsedUs > prevMax && !m_extraIndex->m_maxSplitTimeUs.compare_exchange_weak(prevMax, elapsedUs)); if (ret != ErrorCode::Success) { + // Same classification scheme as MergeAsyncJob. + // Splits are designed safe to retry idempotently + // (read-deduplicate during the next attempt handles + // partial writes from a previously-crashed attempt). int maxRetry = m_extraIndex->m_opt ? m_extraIndex->m_opt->m_asyncJobMaxRetry : 0; - if (m_attempts + 1 < maxRetry) { - // See MergeAsyncJob: splits are designed safe to - // retry from any compute node (read-deduplicate - // during the next attempt handles partial writes). - // Enqueue a fresh Job — the ThreadPool worker will - // `delete` *this* after we return. + bool transient = Distributed::IsTransientAsyncJobError(ret); + if (transient && m_attempts + 1 < maxRetry) { + int backoffMs = Distributed::AsyncJobRetryBackoffMs(m_attempts); SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "SplitAsyncJob: head=%lld attempt=%d failed ret=%d, re-enqueueing\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret); + "SplitAsyncJob: head=%lld attempt=%d failed ret=%d (transient), backoff=%dms\n", + (std::int64_t)m_headID, m_attempts + 1, (int)ret, backoffMs); auto* retryJob = new SplitAsyncJob(m_extraIndex, m_headID, m_callback); retryJob->m_attempts = m_attempts + 1; - m_extraIndex->m_splitThreadPool->add(retryJob); + m_extraIndex->GetOrCreateDelayedRetryScheduler().Schedule( + m_extraIndex->m_splitThreadPool, retryJob, backoffMs); return; } - m_extraIndex->m_asyncStatus = ret; - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "SplitAsyncJob: head=%lld giving up after %d attempts ret=%d\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret); + if (!transient) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "SplitAsyncJob: head=%lld permanent failure ret=%d, dropping\n", + (std::int64_t)m_headID, (int)ret); + } else { + m_extraIndex->m_asyncStatus = ret; + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "SplitAsyncJob: head=%lld giving up after %d attempts ret=%d (transient exhausted)\n", + (std::int64_t)m_headID, m_attempts + 1, (int)ret); + } } m_extraIndex->m_splitJobsInFlight--; m_extraIndex->m_totalSplitCompleted++; @@ -4027,6 +4060,22 @@ namespace SPTAG::SPANN { std::shared_ptr m_splitThreadPool; std::shared_ptr m_reassignThreadPool; + + // Single-threaded scheduler used by MergeAsyncJob / SplitAsyncJob + // to re-enqueue retries after exponential backoff (transient + // TiKV/IO failures). Lazily created on first retry to avoid the + // worker thread in single-node / build-only paths that never + // exercise async retries. + std::mutex m_delayedRetrySchedulerMutex; + std::unique_ptr m_delayedRetryScheduler; + + Distributed::DelayedJobScheduler& GetOrCreateDelayedRetryScheduler() { + std::lock_guard g(m_delayedRetrySchedulerMutex); + if (!m_delayedRetryScheduler) { + m_delayedRetryScheduler.reset(new Distributed::DelayedJobScheduler()); + } + return *m_delayedRetryScheduler; + } }; } // namespace SPTAG #endif // _SPTAG_SPANN_EXTRADYNAMICSEARCHER_H_ diff --git a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h index 73f7c9a48..4431460cf 100644 --- a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h +++ b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h @@ -136,7 +136,7 @@ DefineSSDParameter(m_remoteAppendTimeoutSec, int, 180, "RemoteAppendTimeoutSec") // MaxInflight=8 (was 4): keeps the receiver's 16-thread BatchAppendItemJob pool // well-fed even when one chunk straggles on lock contention. DefineSSDParameter(m_remoteAppendMaxInflight, int, 8, "RemoteAppendMaxInflight") -DefineSSDParameter(m_asyncJobMaxRetry, int, 3, "AsyncJobMaxRetry") +DefineSSDParameter(m_asyncJobMaxRetry, int, 8, "AsyncJobMaxRetry") DefineSSDParameter(m_remoteLockTtlMs, int, 30000, "RemoteLockTtlMs") // GPU Building From 19ba298975ce8a7ed814e7f07c93c8f6fb555d61 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Fri, 22 May 2026 08:37:40 +0000 Subject: [PATCH 29/51] perf(distributed): receiver-side batched BatchAppend + fix resurrection bug Five tightly related changes that together raised insert_dominant 2-node throughput from 758/s to 1039/s (+37%) while preserving recall=0.98. 1) Receiver-side BatchAppend fast path Previously, an incoming N-item BatchAppend RPC was unpacked into N separate per-item Jobs, each calling Append() -> db->Merge once. At ChunkSize=10k that meant 10k pool jobs and 10k Merge round-trips per RPC, which saturated the receiver pool and made it the dominant bottleneck (peerOrig pending queue routinely sat above 100k). The new BatchAppendCallback (registered alongside the existing AppendCallback) takes a vector covering an entire layer's worth of items in one RPC. The receiver groups item indices by layer and dispatches ONE BatchAppendLayerJob per layer; that job runs Phase 1 (per-item HandleRaceCondition + resurrection refusal + versionMap mirror) then Phase 2 (group surviving items by headID and call BatchAppend()/db->MultiMerge() ONCE). This matches the local AddIndex fast path's I/O profile. Falls back to the legacy per-item path if a layer has no batch callback registered (early bring-up, partial reload). 2) Fix HandleRaceCondition resurrection bug HandleRaceCondition() previously acquired-and-released the head's RWLock without telling the caller whether a structural op had actually occurred. AppendCallback then unconditionally resurrected missing heads via AddHeadIndex, which could bring back a head a concurrent merge had just deleted. Fix: - HandleRaceCondition() now returns bool observedStructural. - AppendCallback refuses to resurrect when wasMissing && observedStructural, returning ErrorCode::Fail (transient). The sender's retry will re-resolve the owner after HeadSync Delete propagates. 3) Broadcast HeadSync Delete on Merge Split already broadcast HeadSync Delete for losers; MergePostings did not. Without the broadcast, peer compute nodes' head indices kept routing BatchAppend to the deleted head, triggering the resurrection bug. MergePostings now tracks deletedHeadVID in both loser branches and broadcasts after lock release (skipped when the layer is disk-backed, since TiKV is the source of truth there). 4) Auto-size WAL admission cap from ChunkSize x MaxInflight The receiver's WAL pending-items cap was hardcoded at 50k. When ChunkSize was raised to test 50k, a single chunk immediately tripped the cap and forced every chunk down the slow synchronous- ACK path (chunks timing out at the 180s RPC deadline). ExtraDynamicSearcher::SetWorker now derives the cap as ChunkSize * MaxInflight * 2 from the SPANN options, so the cap scales with the configured in-flight window. Default ChunkSize bumped 10000 -> 20000 (the receiver-side batched path makes the per-Merge fixed cost much cheaper, so larger chunks amortize the network roundtrip better without inflating the receiver pool depth). 5) Simplify ownership filtering Remove duplicate IsRemoteOwnedHead() body-side checks in Split() and MergePostings(). The single authoritative gate lives in SplitAsync()/MergeAsync(); the hash ring is static after init and only layer 0 routes anyway, so the body re-check was dead code. Saves one GetOwner() per executed Split/Merge job. Diagnostics: - progress log split: 'pending queue local/remote' relabeled to selfOrig/peerOrig, with clarifying comment that selfOrig=0 is expected (local-owned items bypass the pool via synchronous MultiMerge) and peerOrig is what the receiver-side work counts. - new addIndex route counters track heads(local:X remote:Y) items(local:I remote:J) in BatchAppend's TryRouteRemoteAppend decision, surfacing ownership skew in the progress log. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemotePostingOps.h | 212 +++++++++++- .../inc/Core/SPANN/Distributed/WorkerNode.h | 2 + .../inc/Core/SPANN/ExtraDynamicSearcher.h | 306 +++++++++++++++--- .../inc/Core/SPANN/ParameterDefinitionList.h | 13 +- 4 files changed, 470 insertions(+), 63 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 5be825651..fd4c607a2 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -52,6 +52,19 @@ namespace SPTAG::SPANN { int appendNum, std::string& appendPosting)>; + // Receiver-side batched callback: deliver a whole BatchRemoteAppend + // request to the searcher so it can group items by head and call + // its native BatchAppend / db->MultiMerge path with ONE TiKV op + // covering N items, instead of unpacking into N pool jobs that + // each issue an individual Merge. Mirrors the local AddIndex + // path which already batches. outSuccess and outFail accumulate + // per-item results so the caller can ACK with the same shape as + // the legacy per-item path. + using BatchAppendCallback = std::function& items, + std::uint32_t& outSuccess, + std::uint32_t& outFail)>; + using HeadSyncCallback = std::function; // RemoteLockCallback: // For Lock op: token argument is 0; returns issued fencing token @@ -207,6 +220,14 @@ namespace SPTAG::SPANN { EnsureLayerSlot_NoLock(layer); m_appendCallbacks[layer] = std::move(cb); } + void SetBatchAppendCallback(int layer, BatchAppendCallback cb) { + std::unique_lock lk(m_callbackLifetimeMutex); + EnsureLayerSlot_NoLock(layer); + if (m_batchAppendCallbacks.size() < static_cast(layer) + 1) { + m_batchAppendCallbacks.resize(layer + 1); + } + m_batchAppendCallbacks[layer] = std::move(cb); + } void SetHeadSyncCallback(int layer, HeadSyncCallback cb) { std::unique_lock lk(m_callbackLifetimeMutex); EnsureLayerSlot_NoLock(layer); @@ -239,6 +260,7 @@ namespace SPTAG::SPANN { void ClearCallbacks() { std::unique_lock lk(m_callbackLifetimeMutex); m_appendCallbacks.clear(); + m_batchAppendCallbacks.clear(); m_headSyncCallbacks.clear(); m_remoteLockCallbacks.clear(); m_mergeCallbacks.clear(); @@ -269,6 +291,9 @@ namespace SPTAG::SPANN { return false; } m_appendCallbacks[layer] = nullptr; + if (layer >= 0 && static_cast(layer) < m_batchAppendCallbacks.size()) { + m_batchAppendCallbacks[layer] = nullptr; + } m_headSyncCallbacks[layer] = nullptr; m_remoteLockCallbacks[layer] = nullptr; if (layer >= 0 && static_cast(layer) < m_mergeCallbacks.size()) { @@ -287,6 +312,11 @@ namespace SPTAG::SPANN { const auto& cb = m_appendCallbacks[layer]; return cb ? &cb : nullptr; } + const BatchAppendCallback* LookupBatchAppendCallback_Locked(int layer) const { + if (layer < 0 || static_cast(layer) >= m_batchAppendCallbacks.size()) return nullptr; + const auto& cb = m_batchAppendCallbacks[layer]; + return cb ? &cb : nullptr; + } const HeadSyncCallback* LookupHeadSyncCallback_Locked(int layer) const { if (layer < 0 || static_cast(layer) >= m_headSyncCallbacks.size()) return nullptr; const auto& cb = m_headSyncCallbacks[layer]; @@ -957,11 +987,19 @@ namespace SPTAG::SPANN { /*sendResponse=*/true, packetPtr); } - // Submit each item of `batchReq` to its per-layer job submitter. - // If sendResponse is true, the last completing job ACKs the sender - // via ackPacket. If sendResponse is false (WAL-backed path or - // crash recovery), the last completing job deletes the WAL entry - // identified by `batchID`. + // Submit a BatchAppend request to the local pool for processing. + // Two paths: + // * Batched (preferred): if the searcher registered a + // BatchAppendCallback for the request's layer, dispatch ONE + // Job per layer covering all items for that layer. The + // callback groups by headID and issues db->MultiMerge once, + // matching the local AddIndex throughput profile. + // * Per-item (fallback): legacy path used when no batch + // callback is registered. Creates one Job per item and the + // last one ACKs. + // If sendResponse is true, the LAST completing Job ACKs the + // sender via ackPacket; if false (WAL-backed path), the last Job + // deletes the WAL entry identified by `batchID` instead. void SubmitBatchItems(std::shared_ptr batchReq, std::uint64_t batchID, bool sendResponse, @@ -971,7 +1009,6 @@ namespace SPTAG::SPANN { if (sendResponse && ackPacket) SendBatchAppendResponse(*ackPacket, 0, 0); return; } - auto remaining = std::make_shared>(total); auto successCount = std::make_shared>(0); auto failCount = std::make_shared>(0); @@ -998,6 +1035,75 @@ namespace SPTAG::SPANN { return; } + // Group item indices by layer. We need the layer split because + // each layer has its own job submitter and its own searcher's + // batch callback. Within a layer all items go to one Job. + std::unordered_map> byLayer; + byLayer.reserve(4); + for (size_t i = 0; i < total; ++i) { + byLayer[batchReq->m_items[i].m_layer].push_back(i); + } + + // Check whether every layer in this request has a batch + // callback registered. If even one is missing we fall back to + // the per-item path for the whole request to keep the + // success/fail accounting consistent with the legacy ACK + // shape (one fetch_add per item). + bool allBatchable = true; + { + std::shared_lock cbLock(m_callbackLifetimeMutex); + for (const auto& kv : byLayer) { + if (!LookupBatchAppendCallback_Locked(kv.first)) { + allBatchable = false; + break; + } + } + } + + if (allBatchable) { + auto remainingLayers = std::make_shared>(byLayer.size()); + for (auto& kv : byLayer) { + int layer = kv.first; + const JobSubmitter* sub = nullptr; + if (layer >= 0 && static_cast(layer) < m_jobSubmitters.size() + && m_jobSubmitters[layer]) { + sub = &m_jobSubmitters[layer]; + } else { + for (auto& s : m_jobSubmitters) { if (s) { sub = &s; break; } } + } + if (sub) { + // Per-layer gauge: this Job represents + // kv.second.size() peer-origin items even though + // it's a single Job. Match item count, not Job + // count, so the gauge stays comparable to the + // per-item-path value. + RemoteOriginPendingSlot(layer).fetch_add(kv.second.size(), + std::memory_order_relaxed); + auto* job = new BatchAppendLayerJob( + this, batchReq, std::move(kv.second), layer, + remainingLayers, successCount, failCount, + ackPacket, sendResponse, batchID); + (*sub)(job); + } else { + failCount->fetch_add(kv.second.size()); + if (remainingLayers->fetch_sub(1) == 1) { + if (sendResponse && ackPacket) { + SendBatchAppendResponse(*ackPacket, + successCount->load(), failCount->load()); + } else if (batchID != 0) { + auto wal = GetBatchAppendWAL(); + if (wal) wal->Delete(batchID); + NoteWalPendingItemsDrained(batchReq->m_items.size()); + } + } + } + } + return; + } + + // Fallback: per-item path (legacy). Used until a searcher + // installs the batch callback (e.g. during early bring-up). + auto remaining = std::make_shared>(total); for (size_t i = 0; i < total; i++) { auto* job = new BatchAppendItemJob( this, batchReq, i, remaining, successCount, failCount, @@ -1435,6 +1541,7 @@ namespace SPTAG::SPANN { // by request.m_layer is required to avoid routing layer-0 events to // layer-1's storage and vice versa. std::vector m_appendCallbacks; + std::vector m_batchAppendCallbacks; std::vector m_headSyncCallbacks; std::vector m_remoteLockCallbacks; std::vector m_mergeCallbacks; @@ -1466,6 +1573,99 @@ namespace SPTAG::SPANN { std::mutex m_pendingLockTokensMutex; std::unordered_map m_pendingLockTokens; + // Per-LAYER Job: a single Job processes ALL items for one layer + // from a BatchRemoteAppend RPC. Calls the searcher's batched + // callback (BatchAppendCallback) which groups items by headID and + // issues ONE db->MultiMerge instead of N individual Merges -- + // mirrors the local AddIndex BatchAppend path so receiver-side + // throughput matches sender-side. Replaces the legacy + // BatchAppendItemJob fan-out (one Job per item) when the searcher + // has registered a batch callback; otherwise the per-item path is + // still used as a fallback. + class BatchAppendLayerJob : public Helper::ThreadPool::Job { + public: + BatchAppendLayerJob(RemotePostingOps* ops, + std::shared_ptr batchReq, + std::vector indices, + int layer, + std::shared_ptr> remainingLayers, + std::shared_ptr> successCount, + std::shared_ptr> failCount, + std::shared_ptr replyPacket, + bool sendResponse, + std::uint64_t batchID) + : m_ops(ops), m_batchReq(std::move(batchReq)), + m_indices(std::move(indices)), m_layer(layer), + m_remaining(std::move(remainingLayers)), + m_success(std::move(successCount)), + m_fail(std::move(failCount)), + m_replyPacket(std::move(replyPacket)), + m_sendResponse(sendResponse), + m_batchID(batchID) {} + + void exec(IAbortOperation*) override { run(); } + void exec(void* workspace, IAbortOperation*) override { + void* prev = tls_preallocAppendWorkSpace; + tls_preallocAppendWorkSpace = workspace; + run(); + tls_preallocAppendWorkSpace = prev; + } + + private: + void run() { + std::vector items; + items.reserve(m_indices.size()); + for (size_t idx : m_indices) { + items.push_back(&m_batchReq->m_items[idx]); + } + + std::uint32_t succ = 0, fail = 0; + { + std::shared_lock cbLock(m_ops->m_callbackLifetimeMutex); + const auto* cb = m_ops->LookupBatchAppendCallback_Locked(m_layer); + if (cb) { + (*cb)(items, succ, fail); + } else { + // Searcher detached between dispatch and run; mark + // everything as failed so the sender can retry. + fail = static_cast(items.size()); + } + } + m_success->fetch_add(succ); + m_fail->fetch_add(fail); + // Decrement per-layer remote-origin gauge by the count of + // items this job represents (paired with the matching + // increment in SubmitBatchItems). + { + auto& slot = m_ops->RemoteOriginPendingSlot(m_layer); + std::size_t toSub = m_indices.size(); + std::size_t prev = slot.fetch_sub(toSub, std::memory_order_relaxed); + if (prev < toSub) slot.store(0, std::memory_order_relaxed); + } + if (m_remaining->fetch_sub(1) == 1) { + if (m_sendResponse && m_replyPacket) { + m_ops->SendBatchAppendResponse( + *m_replyPacket, m_success->load(), m_fail->load()); + } else if (m_batchID != 0) { + auto wal = m_ops->GetBatchAppendWAL(); + if (wal) wal->Delete(m_batchID); + m_ops->NoteWalPendingItemsDrained(m_batchReq->m_items.size()); + } + } + } + + RemotePostingOps* m_ops; + std::shared_ptr m_batchReq; + std::vector m_indices; + int m_layer; + std::shared_ptr> m_remaining; + std::shared_ptr> m_success; + std::shared_ptr> m_fail; + std::shared_ptr m_replyPacket; + bool m_sendResponse; + std::uint64_t m_batchID; + }; + // Per-item Job: each remote append request becomes one Job submitted // to the searcher's shared SPDKThreadPool. The last completing Job // ACKs the sender. Identical to how a local insert thread would call diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index b8fa36998..116b6c25f 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -35,6 +35,7 @@ namespace SPTAG::SPANN { class WorkerNode : public NetworkNode { public: using AppendCallback = RemotePostingOps::AppendCallback; + using BatchAppendCallback = RemotePostingOps::BatchAppendCallback; using DispatchCallback = DispatchCoordinator::DispatchCallback; using HeadSyncCallback = RemotePostingOps::HeadSyncCallback; using RemoteLockCallback = RemotePostingOps::RemoteLockCallback; @@ -110,6 +111,7 @@ namespace SPTAG::SPANN { // request.m_layer. void SetAppendCallback(int layer, AppendCallback cb) { m_remoteOps.SetAppendCallback(layer, std::move(cb)); } + void SetBatchAppendCallback(int layer, BatchAppendCallback cb) { m_remoteOps.SetBatchAppendCallback(layer, std::move(cb)); } void SetHeadSyncCallback(int layer, HeadSyncCallback cb) { m_remoteOps.SetHeadSyncCallback(layer, std::move(cb)); } void SetRemoteLockCallback(int layer, RemoteLockCallback cb) { m_remoteOps.SetRemoteLockCallback(layer, std::move(cb)); } void SetFenceValidator(int layer, FenceValidator cb) { m_remoteOps.SetFenceValidator(layer, std::move(cb)); } diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 6f190f197..fefd20b24 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -290,18 +290,16 @@ namespace SPTAG::SPANN { } }; - private: - std::atomic m_workspaceCount = 0; - - std::shared_ptr db; - WorkerNode* m_worker = nullptr; // externally owned, set via SetWorker() - public: // Expose the underlying KV handle so a standalone WorkerNode can be wired to the // same DB this searcher already opened, instead of opening a second one. std::shared_ptr GetDB() const { return db; } private: + std::atomic m_workspaceCount = 0; + std::shared_ptr db; + WorkerNode* m_worker = nullptr; // externally owned, set via SetWorker() + SPANN::Index* m_headIndex; std::unique_ptr m_versionMap; Options* m_opt; @@ -321,11 +319,7 @@ namespace SPTAG::SPANN { // Distributed/HeadSyncLog.h and Distributed/SplitWAL.h. std::unique_ptr m_headSyncLog; std::unique_ptr m_splitWAL; - // Receiver-side Batch WAL for cross-owner BatchAppend (Option A). - // Owned by each layer's searcher but the same TiKV cluster, keyed - // by receiver node index; layer-0 is the only owner that wires it - // into the WorkerNode (only one WAL per receiver, regardless of - // how many layers exist). + // Receiver-side Batch WAL for cross-owner BatchAppend std::shared_ptr m_batchAppendWAL; std::atomic m_splitJobIdCounter{ 0 }; @@ -352,6 +346,15 @@ namespace SPTAG::SPANN { std::atomic_size_t m_totalAppendCompleted{ 0 }; std::atomic_size_t m_totalAppendCount{ 0 }; + // Routing counters for local AddIndex calls so we can verify + // GetOwner is partitioning work evenly. Incremented in + // BatchAppend()/Append() based on whether TryRouteRemoteAppend + // shipped the head to a peer or it stayed local. + std::atomic_size_t m_routedLocalHeads{ 0 }; + std::atomic_size_t m_routedRemoteHeads{ 0 }; + std::atomic_size_t m_routedLocalItems{ 0 }; + std::atomic_size_t m_routedRemoteItems{ 0 }; + std::atomic_size_t m_reassignJobsInFlight{ 0 }; std::atomic_size_t m_totalReassignSubmitted{ 0 }; std::atomic_size_t m_totalReassignCompleted{ 0 }; @@ -504,7 +507,14 @@ namespace SPTAG::SPANN { // broadcast), the callback re-checks ContainSample with a stable // view. When the head is genuinely gone, sender retries against // the updated head index and routes to the new owner. - void HandleRaceCondition(SizeType headID) { + // + // Returns true if a structural op was observed (the head was in + // m_splitList or m_mergeList at check time). The AppendCallback + // uses this to refuse resurrecting a head that was likely just + // deleted by the wait-on-RWLock'd structural op: resurrecting + // would race against the merge's HeadSync Delete broadcast and + // leave a zombie head until the next merge round drops it again. + bool HandleRaceCondition(SizeType headID) { bool inSplit = false, inMerge = false; { std::shared_lock sl(m_splitListLock); @@ -514,11 +524,12 @@ namespace SPTAG::SPANN { std::shared_lock sl(m_mergeListLock); inMerge = (m_mergeList.find(headID) != m_mergeList.end()); } - if (!inSplit && !inMerge) return; + if (!inSplit && !inMerge) return false; // Wait until the structural op releases the per-head RWLock. // Acquire-and-immediately-release; the Append below re-locks. std::unique_lock w(m_rwLocks[headID]); (void)w; + return true; } // SPDKThreadPool. Called both after pool creation and from @@ -548,6 +559,13 @@ namespace SPTAG::SPANN { m_worker->SetRpcRetry(m_opt->m_remoteAppendRetry); m_worker->SetRpcTimeoutSec(m_opt->m_remoteAppendTimeoutSec); m_worker->SetRpcMaxInflightPerNode(m_opt->m_remoteAppendMaxInflight); + // Size the receiver's WAL admission cap so a normal in-flight + // window (ChunkSize × MaxInflight) fits before backpressure + // engages. A too-low cap forces every chunk down the slow + // synchronous-ACK path; too-high removes the safety net. + const std::size_t chunk = (std::size_t)std::max(1, m_opt->m_remoteAppendChunkSize); + const std::size_t inflight = (std::size_t)std::max(1, m_opt->m_remoteAppendMaxInflight); + m_worker->SetBatchAppendWalPendingItemsCap(chunk * inflight * 2); } // Initialize durable HeadSync log + SplitWAL once we know the @@ -588,7 +606,7 @@ namespace SPTAG::SPANN { // the head index. Otherwise the wasMissing branch // below can resurrect a head that the structural op // just deleted. - HandleRaceCondition(headID); + bool observedStructural = HandleRaceCondition(headID); // Reuse SPDKThreadPool's per-worker pre-allocated workspace // when called from BatchAppendItemJob on m_splitThreadPool. @@ -599,6 +617,21 @@ namespace SPTAG::SPANN { ws = &localWorkSpace; } bool wasMissing = !m_headIndex->ContainSample(headID, m_layer + 1); + if (wasMissing && observedStructural) { + // We waited for an in-flight Split/Merge and the + // head is gone afterwards -- the structural op + // deleted it on purpose. Resurrecting via + // AddHeadIndex would race the structural op's + // HeadSync Delete broadcast and leave a zombie + // head until the next merge round drops it again. + // Refuse the append; the sender's retry path will + // re-resolve once HeadSync propagates the + // deletion to its head index. + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, + "AppendCallback: head=%lld deleted by local structural op; refusing resurrection\n", + (std::int64_t)headID); + return ErrorCode::Fail; + } if (wasMissing && headVec && !headVec->empty()) { DimensionType dim = static_cast( headVec->size() / sizeof(ValueType)); @@ -638,6 +671,111 @@ namespace SPTAG::SPANN { return Append(ws, headID, appendNum, appendPosting, 0); }); + // Batch append callback: receiver-side fast path. Replaces + // the per-item job fan-out with a single Job per layer that + // groups items by headID and issues ONE db->MultiMerge, + // matching the local AddIndex BatchAppend throughput profile. + // Without this, a single 10k-item peer RPC inflates the + // receiver's pool by 10k jobs and 10k Merge calls -- the + // dominant receiver-side bottleneck observed in 2-node tests. + m_worker->SetBatchAppendCallback(m_layer, + [this](std::vector& items, + std::uint32_t& outSuccess, std::uint32_t& outFail) { + outSuccess = 0; + outFail = 0; + if (items.empty()) return; + + ExtraWorkSpace localWorkSpace; + ExtraWorkSpace* ws = static_cast(tls_preallocAppendWorkSpace); + if (!ws) { + m_headIndex->InitWorkSpace(&localWorkSpace); + ws = &localWorkSpace; + } + + // Phase 1: per-head prep (race-condition wait, + // resurrection or refusal) and per-item versionMap + // mirroring. Items refused at this phase count as + // failures and are excluded from the MultiMerge. + std::vector alive(items.size(), true); + for (size_t i = 0; i < items.size(); ++i) { + auto* req = items[i]; + if (req->m_appendPosting.empty() || req->m_appendNum == 0) { + // Defensive drop (matches Append()'s gate). + alive[i] = false; + ++outSuccess; + continue; + } + bool observedStructural = HandleRaceCondition(req->m_headID); + bool wasMissing = !m_headIndex->ContainSample(req->m_headID, m_layer + 1); + if (wasMissing && observedStructural) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, + "BatchAppendCallback: head=%lld deleted by local structural op; refusing\n", + (std::int64_t)req->m_headID); + alive[i] = false; + ++outFail; + continue; + } + if (wasMissing && !req->m_headVec.empty()) { + DimensionType dim = static_cast( + req->m_headVec.size() / sizeof(ValueType)); + m_headIndex->AddHeadIndex(req->m_headVec.data(), + req->m_headID, 0, dim, m_layer + 1, ws); + } + + // Mirror sender's versionMap for the records we're + // about to persist (otherwise MergePostings / + // SearchIndex would drop them as stale). + const uint8_t* basePtr = + reinterpret_cast(req->m_appendPosting.data()); + size_t totalRec = req->m_appendPosting.size() / m_vectorInfoSize; + EnsureVersionMapCoversPosting(basePtr, totalRec, + "BatchAppendCallback", req->m_headID); + const SizeType localCount = m_versionMap->Count(); + std::vector batchVids; + std::vector batchVers; + batchVids.reserve(totalRec); + batchVers.reserve(totalRec); + for (size_t k = 0; k < totalRec; ++k) { + const uint8_t* p = basePtr + k * m_vectorInfoSize; + SizeType vid = *reinterpret_cast(p); + uint8_t recVer = *(p + sizeof(SizeType)); + if (vid < 0 || vid >= localCount) continue; + if (recVer == 0xfe) continue; + uint8_t curVer = m_versionMap->GetVersion(vid); + if (curVer == 0xfe) continue; + if (curVer == recVer) continue; + batchVids.push_back(vid); + batchVers.push_back(recVer); + } + if (!batchVids.empty()) { + m_versionMap->SetVersionBatch(batchVids, batchVers); + } + } + + // Phase 2: group surviving items by headID, then + // hand the grouped map to BatchAppend so it issues + // a single db->MultiMerge for all heads. + std::unordered_map headAppends; + headAppends.reserve(items.size()); + size_t aliveCount = 0; + for (size_t i = 0; i < items.size(); ++i) { + if (!alive[i]) continue; + auto* req = items[i]; + auto& dst = headAppends[req->m_headID]; + if (dst.empty()) dst = std::move(req->m_appendPosting); + else dst.append(req->m_appendPosting); + ++aliveCount; + } + if (headAppends.empty()) return; + + ErrorCode ret = BatchAppend(ws, headAppends, "PeerBatch"); + if (ret == ErrorCode::Success) { + outSuccess += static_cast(aliveCount); + } else { + outFail += static_cast(aliveCount); + } + }); + // Head sync callback: apply head index updates from peers auto* headIndex = m_headIndex; int layer = m_layer; @@ -1196,17 +1334,10 @@ namespace SPTAG::SPANN { uint64_t splitPostingVectors = 0; uint64_t splitNewHeadCount = 0; - // Only the OWNER of headID should run Split. Remote-issued - // splits get dropped early so we don't mutate a posting that - // doesn't live on this node. - if (IsRemoteOwnedHead(headID)) { - std::unique_lock tmplock(m_splitListLock); - m_splitList.unsafe_erase(headID); - return ErrorCode::Success; - } - - // Owner-side: wait for any in-flight remote-initiated lock on - // this bucket to release the advisory flag before we mutate. + // Ownership filtering is the single gate inside SplitAsync; by + // the time we get here the head is guaranteed local-owned. No + // re-check needed (hash ring is static once initialized, and + // only layer 0 routes anyway). WaitForRemoteBucketUnlocked(headID); { @@ -1695,15 +1826,10 @@ namespace SPTAG::SPANN { ErrorCode MergePostings(ExtraWorkSpace *p_exWorkSpace, SizeType headID) { - // The owner runs its own merge passes. Skip when this head is - // owned by another node — we'd just be racing the owner. - // (Defense in depth: MergeAsync already filters at enqueue, but - // ownership can change between enqueue and execution.) - if (IsRemoteOwnedHead(headID)) { - std::unique_lock tmplock(m_mergeListLock); - m_mergeList.unsafe_erase(headID); - return ErrorCode::Success; - } + // Ownership filtering is the single gate inside MergeAsync; by + // the time we get here the head is guaranteed local-owned. No + // re-check needed (hash ring is static once initialized, and + // only layer 0 routes anyway). WaitForRemoteBucketUnlocked(headID); std::unique_lock lock(m_rwLocks[headID]); @@ -1724,6 +1850,16 @@ namespace SPTAG::SPANN { std::string mergedPostingList; std::set vectorIdSet; + // Tracks the loser VID after a successful merge so we can + // broadcast a HeadSync Delete entry to peers after releasing + // the per-head RWLock. Split mirrors this pattern at + // line ~1620 with both Add (new heads) and Delete (original + // head) entries. Without this broadcast, peers keep routing + // BatchAppend traffic to the deleted head -- the receiver's + // AppendCallback wasMissing branch would then resurrect a + // dead head, leaving a zombie until the next merge round. + SizeType deletedHeadVID = -1; + std::string currentPostingList; ErrorCode ret; { @@ -1927,6 +2063,7 @@ namespace SPTAG::SPANN { return ret; } } + deletedHeadVID = queryResult->VID; nextHeadID = headID; nextHeadVec = headVec; deletedHeadVec = resultVec; @@ -1960,6 +2097,7 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete old posting %lld in Merge\n", (std::int64_t)(headID)); return ret; } + deletedHeadVID = headID; nextHeadID = queryResult->VID; nextHeadVec = resultVec; deletedHeadVec = headVec; @@ -2008,6 +2146,30 @@ namespace SPTAG::SPANN { MergeAsync(nextHeadID); } } + + // Broadcast HeadSync Delete for the merge loser so peer + // compute nodes drop it from their in-memory head index. + // Without this, peers keep routing BatchAppend traffic to + // the deleted head; the receiver's AppendCallback then + // either resurrects it (zombie) or refuses (sender retry + // loop) until the next merge round happens to delete it + // again. Mirrors the Split broadcast at line ~1620. + // Skipped when our layer is disk-backed (TiKV is source + // of truth there) or when no worker is wired. + if (deletedHeadVID != -1 && m_worker && m_worker->IsEnabled() + && m_headIndex->GetDiskIndex(m_layer + 1) == nullptr) { + std::vector headSyncEntries; + HeadSyncEntry entry; + entry.op = HeadSyncEntry::Op::Delete; + entry.headVID = deletedHeadVID; + entry.m_layer = m_layer; + headSyncEntries.push_back(std::move(entry)); + if (m_headSyncLog) { + int shard = m_worker->GetWorkerNodeIndex(); + m_headSyncLog->Append(shard, headSyncEntries); + } + m_worker->BroadcastHeadSync(headSyncEntries); + } m_stat.m_mergeNum++; return ErrorCode::Success; } @@ -2030,9 +2192,11 @@ namespace SPTAG::SPANN { inline void SplitAsync(SizeType headID, int postingSize, std::function p_callback = nullptr) { - // Don't enqueue split jobs for heads we don't own; the owner - // will detect oversize on its own. Skipping here avoids - // burning a thread-pool slot only to drop the job in Split(). + // Single authoritative ownership gate. Sources of remote-owned + // headIDs that legitimately reach here: RefineIndex full scan, + // Search→MergeAsync via search result, Split-internal re-enqueue + // for new-head VIDs, MergePostings re-merge of survivor. Drop + // them so the owner runs its own structural pass. if (IsRemoteOwnedHead(headID)) return; { Helper::Concurrent::ConcurrentMap::value_type workPair(headID, postingSize); @@ -2054,10 +2218,11 @@ namespace SPTAG::SPANN { inline void MergeAsync(SizeType headID, std::function p_callback = nullptr) { - // Don't enqueue merge jobs for heads we don't own; the owner - // runs its own merge pass. Filtering here is the single - // upstream gate so MergePostings's owner check is only a - // defense-in-depth net. + // Single authoritative ownership gate. Sources of remote-owned + // headIDs that legitimately reach here: RefineIndex full scan, + // Search→MergeAsync via search result, MergePostings re-merge of + // survivor (nextHeadID). Drop them so the owner runs its own + // merge pass. if (IsRemoteOwnedHead(headID)) return; { std::shared_lock tmplock(m_mergeListLock); @@ -2531,8 +2696,16 @@ namespace SPTAG::SPANN { (int)(posting.size() / m_vectorInfoSize), posting, headVecBytes)) { + m_routedRemoteHeads.fetch_add(1, std::memory_order_relaxed); + m_routedRemoteItems.fetch_add( + posting.size() / m_vectorInfoSize, + std::memory_order_relaxed); continue; } + m_routedLocalHeads.fetch_add(1, std::memory_order_relaxed); + m_routedLocalItems.fetch_add( + posting.size() / m_vectorInfoSize, + std::memory_order_relaxed); } std::unique_lock headLock(m_rwLocks[headID]); @@ -3777,25 +3950,48 @@ namespace SPTAG::SPANN { walPending = m_worker->GetBatchAppendWalPendingItems(); remoteOriginPending = m_worker->GetRemoteOriginPendingItems(m_layer); } - // Split the local pool's pending queue into the portion - // serving peer-originated BatchAppend items vs the residual - // (local-origin RMWs, split/merge/reassign jobs). Helps - // operators distinguish "I'm bottlenecked applying remote - // work" from "my own inserts are backlogged". - size_t localPending = totalJobs > remoteOriginPending + // Split the local pool's pending queue by ORIGIN of the + // work, not by processing site. Both buckets are being + // processed locally on this node's SPDKThreadPool: + // selfOrig: jobs the local AddIndex generated (own + // splits/merges/reassigns/appends). + // peerOrig: BatchAppendItemJob unpacked from BatchAppend + // RPCs that peers routed to us because we own + // the head. When peer A sends 10000 items to + // us they land here, not in A's queue. + // Items WE dispatched to peers (and are waiting on their + // response) are reported separately as "remote out + // queueDepth" + "inflightChunks" + "walPendingItems". + // + // Asymmetry note: selfOrig is usually near 0 even when + // GetOwner is perfectly balanced. Local AddIndex calls + // for LOCAL-owned heads bypass the pool entirely (one + // synchronous db->MultiMerge per BatchAppend batch + // covers them all). Peer-originated BatchAppend + // requests, by contrast, unpack into ONE pool job per + // item, so a single 10k-item RPC inflates peerOrig by + // 10k. Use "addIndex route" below to verify owner + // partitioning is healthy. + size_t selfOrigPending = totalJobs > remoteOriginPending ? totalJobs - remoteOriginPending : 0; + size_t routedLocalH = m_routedLocalHeads.load(); + size_t routedRemoteH = m_routedRemoteHeads.load(); + size_t routedLocalI = m_routedLocalItems.load(); + size_t routedRemoteI = m_routedRemoteItems.load(); SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "layer %d pending queue:%zu (local:%zu remote:%zu) split:%zu merge:%zu append:%zu reassign:%zu running:%u | " + "layer %d pending queue:%zu (selfOrig:%zu peerOrig:%zu) split:%zu merge:%zu append:%zu reassign:%zu running:%u | " "total_submitted split:%zu merge:%zu reassign:%zu append:%zu | " "total_completed split:%zu merge:%zu reassign:%zu | " + "addIndex route heads(local:%zu remote:%zu) items(local:%zu remote:%zu) | " "remote out queueDepth:%zu inflightChunks:%d totalRouted:%zu walPendingItems:%zu | " "split_latency avg:%.1fms max:%.1fms\n", - m_layer, totalJobs, localPending, remoteOriginPending, + m_layer, totalJobs, selfOrigPending, remoteOriginPending, m_splitJobsInFlight.load(), m_mergeJobsInFlight.load(), m_appendJobsInFlight.load(), m_reassignJobsInFlight.load(), runningJobs, m_totalSplitSubmitted.load(), m_totalMergeSubmitted.load(), m_totalReassignSubmitted.load(), m_totalAppendCount.load(), m_totalSplitCompleted.load(), m_totalMergeCompleted.load(), m_totalReassignCompleted.load(), + routedLocalH, routedRemoteH, routedLocalI, routedRemoteI, remoteQ, remoteInflight, remoteTotal, walPending, avgSplitMs, maxSplitMs); } @@ -3924,21 +4120,27 @@ namespace SPTAG::SPANN { walPending = m_worker->GetBatchAppendWalPendingItems(); remoteOriginPending = m_worker->GetRemoteOriginPendingItems(m_layer); } - size_t localPending = totalJobs > remoteOriginPending + size_t selfOrigPending = totalJobs > remoteOriginPending ? totalJobs - remoteOriginPending : 0; + size_t routedLocalH = m_routedLocalHeads.load(); + size_t routedRemoteH = m_routedRemoteHeads.load(); + size_t routedLocalI = m_routedLocalItems.load(); + size_t routedRemoteI = m_routedRemoteItems.load(); // if (!ShouldLogProgress(totalJobs)) return; SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "layer %d pending queue:%zu (local:%zu remote:%zu) split:%zu merge:%zu append:%zu reassign:%zu running:%u | " + "layer %d pending queue:%zu (selfOrig:%zu peerOrig:%zu) split:%zu merge:%zu append:%zu reassign:%zu running:%u | " "total_submitted split:%zu merge:%zu reassign:%zu append:%zu | " "total_completed split:%zu merge:%zu reassign:%zu | " + "addIndex route heads(local:%zu remote:%zu) items(local:%zu remote:%zu) | " "remote out queueDepth:%zu inflightChunks:%d totalRouted:%zu walPendingItems:%zu | " "split_latency avg:%.1fms max:%.1fms\n", - m_layer, totalJobs, localPending, remoteOriginPending, + m_layer, totalJobs, selfOrigPending, remoteOriginPending, m_splitJobsInFlight.load(), m_mergeJobsInFlight.load(), m_appendJobsInFlight.load(), m_reassignJobsInFlight.load(), m_splitThreadPool ? static_cast(m_splitThreadPool->runningJobs()) : 0, m_totalSplitSubmitted.load(), m_totalMergeSubmitted.load(), m_totalReassignSubmitted.load(), m_totalAppendCount.load(), m_totalSplitCompleted.load(), m_totalMergeCompleted.load(), m_totalReassignCompleted.load(), + routedLocalH, routedRemoteH, routedLocalI, routedRemoteI, remoteQ, remoteInflight, remoteTotal, walPending, avgSplitMs, maxSplitMs); } diff --git a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h index 4431460cf..e3a2c22ab 100644 --- a/AnnService/inc/Core/SPANN/ParameterDefinitionList.h +++ b/AnnService/inc/Core/SPANN/ParameterDefinitionList.h @@ -126,11 +126,14 @@ DefineSSDParameter(m_versionCacheMaxChunks, int, 10000, "VersionCacheMaxChunks") DefineSSDParameter(m_asyncRpcMaxInflight, int, 0, "AsyncRpcMaxInflight") // Distributed RemotePostingOps RPC tuning -// ChunkSize=10000: each in-flight chunk holds enough work to amortize the -// network roundtrip and grpc framing cost (a 3000-item chunk took ~500ms at -// 1M-scale; 10000 should hit ~1.5s and roughly 3× the per-second throughput -// for the same in-flight cap). -DefineSSDParameter(m_remoteAppendChunkSize, int, 10000, "RemoteAppendChunkSize") +// ChunkSize=20000: with the receiver-side BatchAppendLayerJob fast path (one +// db->MultiMerge per chunk instead of N per-item Merges), larger chunks pay +// off — they amortize the network roundtrip without exploding the receiver +// pool depth. 20K is a balance: small enough that ChunkSize × MaxInflight +// stays under the WAL admission-control cap (so chunks take the WAL-backed +// fast-ACK path), large enough that the network roundtrip overhead is small +// vs. per-chunk work. 50K was tried and immediately tripped the WAL cap. +DefineSSDParameter(m_remoteAppendChunkSize, int, 20000, "RemoteAppendChunkSize") DefineSSDParameter(m_remoteAppendRetry, int, 3, "RemoteAppendRetry") DefineSSDParameter(m_remoteAppendTimeoutSec, int, 180, "RemoteAppendTimeoutSec") // MaxInflight=8 (was 4): keeps the receiver's 16-thread BatchAppendItemJob pool From 15f17c9a79655ca8561febabaa3cbb4948758a23 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 03:38:36 +0000 Subject: [PATCH 30/51] fix(distributed): atomic Split locking, drop async retries, drain on shutdown Three related fixes for distributed Split/Merge robustness. 1. Atomic Split lock acquisition (Phase A/B/C/D) Refactor Split() into precompute-plan / build-payloads / acquire-all-locks / execute-writes phases. Closes the strand window where k=0 wrote and k=1 then failed to lock, leaving cluster-1 vectors orphaned. All per-VID local locks (sorted ascending) and per-(owner,bucket) remote fencing-token leases (sorted ascending) are acquired before any DB write; failure cleanly releases and re-enqueues via SplitAsync. The deterministic ordering prevents deadlock between concurrent Splits on overlapping heads. 2. Drop SplitAsync/MergeAsync retries Structural ops are best-effort self-healing: a failed Split leaves the head oversized so the next Append re-triggers SplitAsync; a failed Merge leaves postings undersize so the next Search-driven AsyncMergeInSearch / RefineIndex re-triggers MergeAsync. The previous retry loop burned pool slots and racy-spawned jobs into a torn-down WorkerNode at shutdown, which is what was producing the segfault. 3. Drain async jobs in ~ExtraDynamicSearcher The dtor used to set m_worker=nullptr immediately; in-flight Split/Merge jobs joined later by the ThreadPool dtor then null-deref m_worker via QueueRemoteAppend. Now poll per-layer in-flight counters until zero (30 s timeout) before clearing callbacks, and leave m_worker alone - it is externally owned by the SPFreshTest router. Plus support cleanup: - RemoteLeaseGuard: reusable RAII type with fencing-token validation, replacing the inline RemoteLockGuard helper in MergePostings. - HandleRaceCondition removed: the single-gate refactor at SplitAsync/MergeAsync plus atomic locking above closes the race it was working around; the AppendCallback/BatchAppendCallback wasMissing branch now refuses unconditionally. - MergePostings distinguishes Key_NotFound (skip stale candidate) from other IO failures (propagate) instead of silent-skipping all errors. Measured (2-node insert_dominant, 1M vectors): Insert throughput: 1141.6 /s (baseline 758 /s, +50%) Recall@5: 0.984 Segfaults: 0 (was: shutdown crash every run) Retry log lines: 0 Drain timeouts: 0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 850 ++++++++++-------- 1 file changed, 459 insertions(+), 391 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index fefd20b24..3fc2e639e 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -28,7 +28,10 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -59,6 +62,50 @@ extern "C" bool RocksDbIOUringEnable() { return true; } namespace SPTAG::SPANN { + // RAII lease holder for a remote per-bucket lock issued by + // WorkerNode::SendRemoteLock. Stores the fencing token so the + // release call can be validated by the owner. Used by both Split + // (via a token map for batched acquisition) and MergePostings + // (per-candidate, one lease at a time). + struct RemoteLeaseGuard { + WorkerNode* router = nullptr; + int nodeIndex = -1; + int layer = 0; + SizeType vid = -1; + std::uint64_t token = 0; + + RemoteLeaseGuard() = default; + RemoteLeaseGuard(const RemoteLeaseGuard&) = delete; + RemoteLeaseGuard& operator=(const RemoteLeaseGuard&) = delete; + RemoteLeaseGuard(RemoteLeaseGuard&& o) noexcept { *this = std::move(o); } + RemoteLeaseGuard& operator=(RemoteLeaseGuard&& o) noexcept { + release(); + router = o.router; nodeIndex = o.nodeIndex; layer = o.layer; + vid = o.vid; token = o.token; + o.router = nullptr; o.token = 0; + return *this; + } + ~RemoteLeaseGuard() { release(); } + + // Returns true on success (token != 0). Caller decides whether + // a denial means "skip candidate" or "propagate failure". + bool acquire(WorkerNode* r, int n, int l, SizeType v) { + release(); + if (!r) return false; + std::uint64_t t = r->SendRemoteLock(n, l, v, true, 0); + if (t == 0) return false; + router = r; nodeIndex = n; layer = l; vid = v; token = t; + return true; + } + void release() { + if (router && token) { + router->SendRemoteLock(nodeIndex, layer, vid, false, token); + } + router = nullptr; token = 0; + } + bool active() const { return router != nullptr && token != 0; } + }; + template class ExtraDynamicSearcher : public IExtraSearcher { @@ -68,7 +115,6 @@ namespace SPTAG::SPANN { ExtraDynamicSearcher* m_extraIndex; SizeType m_headID; std::function m_callback; - int m_attempts = 0; public: MergeAsyncJob(ExtraDynamicSearcher* extraIndex, SizeType headID, std::function p_callback) : m_extraIndex(extraIndex), m_headID(headID), m_callback(std::move(p_callback)) {} @@ -79,56 +125,8 @@ namespace SPTAG::SPANN { } inline void exec(void* p_workSpace, IAbortOperation* p_abort) override { ErrorCode ret = m_extraIndex->MergePostings((ExtraWorkSpace*)p_workSpace, m_headID); - if (ret != ErrorCode::Success) { - // Classify before retrying: transient errors (TiKV - // region_error, timeout, generic Fail from the IO - // layer) deserve a bounded retry with exponential - // backoff; permanent errors (data inconsistency, - // unknown ErrorCode) cannot be repaired by retry and - // get dropped with a warning so we don't burn - // pool slots in a hot fail loop. - int maxRetry = m_extraIndex->m_opt - ? m_extraIndex->m_opt->m_asyncJobMaxRetry : 0; - bool transient = Distributed::IsTransientAsyncJobError(ret); - if (transient && m_attempts + 1 < maxRetry) { - // Async-job fault-tolerance contract: merges are - // safe to retry idempotently (the owner check, the - // ContainSample liveness gate, and the locked RMW - // all re-evaluate on each attempt). Enqueue a - // fresh Job carrying the bumped attempt count via - // the delayed-retry scheduler so backoff happens - // OFF the pool worker — the ThreadPool worker - // will `delete` *this* after we return, so we - // cannot re-add the same pointer. Keep - // m_mergeJobsInFlight unchanged: the new job - // takes ownership of the in-flight slot. - int backoffMs = Distributed::AsyncJobRetryBackoffMs(m_attempts); - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "MergeAsyncJob: head=%lld attempt=%d failed ret=%d (transient), backoff=%dms\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret, backoffMs); - auto* retryJob = new MergeAsyncJob(m_extraIndex, m_headID, m_callback); - retryJob->m_attempts = m_attempts + 1; - m_extraIndex->GetOrCreateDelayedRetryScheduler().Schedule( - m_extraIndex->m_splitThreadPool, retryJob, backoffMs); - return; - } - if (!transient) { - // Permanent: log once and drop. Do not promote to - // m_asyncStatus — these are usually local data - // inconsistencies (e.g. version skew) that the - // next caller-driven recovery will repair, and - // poisoning m_asyncStatus would surface them as - // a process-wide failure. - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "MergeAsyncJob: head=%lld permanent failure ret=%d, dropping\n", - (std::int64_t)m_headID, (int)ret); - } else { - m_extraIndex->m_asyncStatus = ret; - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "MergeAsyncJob: head=%lld giving up after %d attempts ret=%d (transient exhausted)\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret); - } - } + if (ret != ErrorCode::Success) + m_extraIndex->m_asyncStatus = ret; m_extraIndex->m_mergeJobsInFlight--; m_extraIndex->m_totalMergeCompleted++; if (m_callback != nullptr) { @@ -143,7 +141,6 @@ namespace SPTAG::SPANN { ExtraDynamicSearcher* m_extraIndex; SizeType m_headID; std::function m_callback; - int m_attempts = 0; public: SplitAsyncJob(ExtraDynamicSearcher* extraIndex, SizeType headID, std::function p_callback) : m_extraIndex(extraIndex), m_headID(headID), m_callback(std::move(p_callback)) {} @@ -160,36 +157,8 @@ namespace SPTAG::SPANN { m_extraIndex->m_totalSplitTimeUs += elapsedUs; uint64_t prevMax = m_extraIndex->m_maxSplitTimeUs.load(); while (elapsedUs > prevMax && !m_extraIndex->m_maxSplitTimeUs.compare_exchange_weak(prevMax, elapsedUs)); - if (ret != ErrorCode::Success) { - // Same classification scheme as MergeAsyncJob. - // Splits are designed safe to retry idempotently - // (read-deduplicate during the next attempt handles - // partial writes from a previously-crashed attempt). - int maxRetry = m_extraIndex->m_opt - ? m_extraIndex->m_opt->m_asyncJobMaxRetry : 0; - bool transient = Distributed::IsTransientAsyncJobError(ret); - if (transient && m_attempts + 1 < maxRetry) { - int backoffMs = Distributed::AsyncJobRetryBackoffMs(m_attempts); - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "SplitAsyncJob: head=%lld attempt=%d failed ret=%d (transient), backoff=%dms\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret, backoffMs); - auto* retryJob = new SplitAsyncJob(m_extraIndex, m_headID, m_callback); - retryJob->m_attempts = m_attempts + 1; - m_extraIndex->GetOrCreateDelayedRetryScheduler().Schedule( - m_extraIndex->m_splitThreadPool, retryJob, backoffMs); - return; - } - if (!transient) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "SplitAsyncJob: head=%lld permanent failure ret=%d, dropping\n", - (std::int64_t)m_headID, (int)ret); - } else { - m_extraIndex->m_asyncStatus = ret; - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "SplitAsyncJob: head=%lld giving up after %d attempts ret=%d (transient exhausted)\n", - (std::int64_t)m_headID, m_attempts + 1, (int)ret); - } - } + if (ret != ErrorCode::Success) + m_extraIndex->m_asyncStatus = ret; m_extraIndex->m_splitJobsInFlight--; m_extraIndex->m_totalSplitCompleted++; if (m_callback != nullptr) { @@ -464,12 +433,39 @@ namespace SPTAG::SPANN { } ~ExtraDynamicSearcher() { + // Order matters: drain async jobs BEFORE nulling m_worker. + // An in-flight SplitAsyncJob may still be inside Split() → + // QueueRemoteAppend; clearing m_worker first turns that into a + // null-deref segfault. Wait for the local pool slice owned by + // *this* layer to quiesce before touching shared state. + DrainAsyncJobs(); if (m_worker) { m_worker->ClearCallbacksIfOwner(m_layer, this); - m_worker = nullptr; } } + // Wait for SplitAsync/MergeAsync/Append jobs targeting THIS layer + // to finish before we tear down. The pool itself may be shared + // with sibling layers / the head index, so we can't just destroy + // it; instead we poll the per-layer in-flight counters. + void DrainAsyncJobs() { + using clock = std::chrono::steady_clock; + auto deadline = clock::now() + std::chrono::seconds(30); + while (clock::now() < deadline) { + int s = m_splitJobsInFlight.load(std::memory_order_relaxed); + int m = m_mergeJobsInFlight.load(std::memory_order_relaxed); + int a = m_appendJobsInFlight.load(std::memory_order_relaxed); + if (s == 0 && m == 0 && a == 0) return; + std::this_thread::sleep_for(std::chrono::milliseconds(20)); + } + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "ExtraDynamicSearcher layer=%d: drain timeout, split=%d merge=%d append=%d still in-flight\n", + m_layer, + (int)m_splitJobsInFlight.load(), + (int)m_mergeJobsInFlight.load(), + (int)m_appendJobsInFlight.load()); + } + int GetNumWorkerNodes() const { if (m_worker && m_worker->IsEnabled()) { return std::max(1, m_worker->GetNumWorkerNodes()); @@ -492,46 +488,6 @@ namespace SPTAG::SPANN { return m_initialVectorSize + (localVID - m_initialVectorSize) * numWorkers + GetWorkerNodeIndex(); } - // Receive-side race coordination: before applying a remote Append - // for headID, make sure no local Split or Merge is currently - // mutating the same head. Splits delete the original head and - // create new ones; merges delete a loser head. If we let the - // append's wasMissing branch run while a Split/Merge holds the - // RWLock, the AddHeadIndex resurrection would race the local - // DeleteIndex and we'd briefly bring a dead head back to life - // (only papered over by the eventual HeadSync from the structural - // op). Briefly acquiring the RWLock here serializes us behind - // the in-flight structural op without forking an explicit - // condition-variable channel. After the structural op completes - // its bookkeeping (lists drained, head index updated, HeadSync - // broadcast), the callback re-checks ContainSample with a stable - // view. When the head is genuinely gone, sender retries against - // the updated head index and routes to the new owner. - // - // Returns true if a structural op was observed (the head was in - // m_splitList or m_mergeList at check time). The AppendCallback - // uses this to refuse resurrecting a head that was likely just - // deleted by the wait-on-RWLock'd structural op: resurrecting - // would race against the merge's HeadSync Delete broadcast and - // leave a zombie head until the next merge round drops it again. - bool HandleRaceCondition(SizeType headID) { - bool inSplit = false, inMerge = false; - { - std::shared_lock sl(m_splitListLock); - inSplit = (m_splitList.find(headID) != m_splitList.end()); - } - { - std::shared_lock sl(m_mergeListLock); - inMerge = (m_mergeList.find(headID) != m_mergeList.end()); - } - if (!inSplit && !inMerge) return false; - // Wait until the structural op releases the per-head RWLock. - // Acquire-and-immediately-release; the Append below re-locks. - std::unique_lock w(m_rwLocks[headID]); - (void)w; - return true; - } - // SPDKThreadPool. Called both after pool creation and from // SetWorker(); whichever happens last actually binds the submitter. // Idempotent: wires the receiver's BatchAppend Jobs onto our shared @@ -601,12 +557,6 @@ namespace SPTAG::SPANN { m_worker->SetAppendCallback(m_layer, [this](SizeType headID, std::shared_ptr headVec, int appendNum, std::string& appendPosting) -> ErrorCode { - // Per-design HandleRaceCondition: wait for any local - // Split/Merge on this head to commit before we look at - // the head index. Otherwise the wasMissing branch - // below can resurrect a head that the structural op - // just deleted. - bool observedStructural = HandleRaceCondition(headID); // Reuse SPDKThreadPool's per-worker pre-allocated workspace // when called from BatchAppendItemJob on m_splitThreadPool. @@ -617,7 +567,7 @@ namespace SPTAG::SPANN { ws = &localWorkSpace; } bool wasMissing = !m_headIndex->ContainSample(headID, m_layer + 1); - if (wasMissing && observedStructural) { + if (wasMissing) { // We waited for an in-flight Split/Merge and the // head is gone afterwards -- the structural op // deleted it on purpose. Resurrecting via @@ -671,13 +621,7 @@ namespace SPTAG::SPANN { return Append(ws, headID, appendNum, appendPosting, 0); }); - // Batch append callback: receiver-side fast path. Replaces - // the per-item job fan-out with a single Job per layer that - // groups items by headID and issues ONE db->MultiMerge, - // matching the local AddIndex BatchAppend throughput profile. - // Without this, a single 10k-item peer RPC inflates the - // receiver's pool by 10k jobs and 10k Merge calls -- the - // dominant receiver-side bottleneck observed in 2-node tests. + // Batch append callback: receiver-side fast path. m_worker->SetBatchAppendCallback(m_layer, [this](std::vector& items, std::uint32_t& outSuccess, std::uint32_t& outFail) { @@ -705,9 +649,9 @@ namespace SPTAG::SPANN { ++outSuccess; continue; } - bool observedStructural = HandleRaceCondition(req->m_headID); + bool wasMissing = !m_headIndex->ContainSample(req->m_headID, m_layer + 1); - if (wasMissing && observedStructural) { + if (wasMissing) { SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "BatchAppendCallback: head=%lld deleted by local structural op; refusing\n", (std::int64_t)req->m_headID); @@ -1333,13 +1277,6 @@ namespace SPTAG::SPANN { double elapsedMSeconds; uint64_t splitPostingVectors = 0; uint64_t splitNewHeadCount = 0; - - // Ownership filtering is the single gate inside SplitAsync; by - // the time we get here the head is guaranteed local-owned. No - // re-check needed (hash ring is static once initialized, and - // only layer 0 routes anyway). - WaitForRemoteBucketUnlocked(headID); - { std::unique_lock lock(m_rwLocks[headID], std::defer_lock); if (requirelock) { @@ -1494,27 +1431,217 @@ namespace SPTAG::SPANN { } else { ks[1] = 1; } - SizeType newHeadVID = -1; - int first = 0; - for (int k : ks) { - if (args.counts[k] == 0) continue; - first = (k == 0) ? 0 : args.counts[0]; - newPostingLists[k].resize(args.counts[k] * m_vectorInfoSize); - char* ptr = (char*)(newPostingLists[k].c_str()); - for (int j = 0; j < args.counts[k]; j++, ptr += m_vectorInfoSize) + // === Phase A: precompute per-child plan (no I/O, no locks) === + // We resolve newHeadVID, isSameHead, and ownership for each of + // the two cluster children up-front so Phase B can acquire + // every lock the split will need before any DB write. This + // closes the strand window where k=0 wrote and k=1 then + // failed to lock, leaving cluster-1's vectors orphaned. + struct ChildPlan { + bool active = false; + bool isSameHead = false; + bool isRemote = false; + int ownerNode = -1; + SizeType newHeadVID = -1; + uint8_t version = 0; + }; + ChildPlan plans[2]; + { + bool tentativeSameHead = false; + for (int k : ks) { + if (args.counts[k] == 0) continue; + plans[k].active = true; + if (!tentativeSameHead && + m_headIndex->ComputeDistance(args.centers + k * args._D, headVec->c_str() + m_metaDataSize) < Epsilon) { + plans[k].isSameHead = true; + plans[k].newHeadVID = headID; + tentativeSameHead = true; + } else { + plans[k].newHeadVID = *((SizeType*)(postingP + args.clusterIdx[k] * m_vectorInfoSize)); + plans[k].version = *((uint8_t*)(postingP + args.clusterIdx[k] * m_vectorInfoSize + sizeof(SizeType))); + int owner = -1; + if (IsRemoteOwnedHead(plans[k].newHeadVID, &owner)) { + plans[k].isRemote = true; + plans[k].ownerNode = owner; + } + } + } + } + + // === Phase B: build per-child posting payloads (memory only) === + { + int first = 0; + for (int k : ks) { + if (!plans[k].active) continue; + first = (k == 0) ? 0 : args.counts[0]; + newPostingLists[k].resize(args.counts[k] * m_vectorInfoSize); + char* ptr = (char*)(newPostingLists[k].c_str()); + for (int j = 0; j < args.counts[k]; j++, ptr += m_vectorInfoSize) { + memcpy(ptr, postingList.c_str() + localIndices[first + j] * m_vectorInfoSize, m_vectorInfoSize); + } + if (plans[k].isSameHead && !hasHead) { + newPostingLists[k] += *headVec; + } + } + } + + // === Phase C: atomically acquire every lock the split needs === + // srcHead lock is already held above. We additionally need + // a per-VID local lock for each local newHead (!=headID), + // and a remote lease (with fencing token) for each remote + // newHead. Acquire in deterministic order (local: VID asc; + // remote: (ownerNode,bucket) asc) so two concurrent Splits + // touching overlapping heads can't deadlock. + // + // If ANY lock cannot be obtained, release whatever we got + // and re-enqueue via SplitAsync. No DB write has happened + // yet, so nothing strands. + std::vector> localChildLocks; + struct RemoteLeaseHeld { std::uint64_t token; int refcount; SizeType sampleVID; }; + std::map, RemoteLeaseHeld> remoteTokens; + + auto bucketKey = [](int owner, SizeType vid) { + return std::make_pair(owner, + COMMON::FineGrainedRWLock::BucketIndex(static_cast(vid))); + }; + + auto releaseRemoteTokens = [&]() { + if (!m_worker) { remoteTokens.clear(); return; } + for (auto& kv : remoteTokens) { + m_worker->SendRemoteLock(kv.first.first, m_layer, + kv.second.sampleVID, false, kv.second.token); + } + remoteTokens.clear(); + }; + + auto reenqueueAndExit = [&](const char* reason) -> ErrorCode { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: lock acquisition failed (%s) for srcHead %lld; re-enqueueing via SplitAsync\n", + reason, (std::int64_t)headID); + releaseRemoteTokens(); + localChildLocks.clear(); // RAII unlock { - memcpy(ptr, postingList.c_str() + localIndices[first + j] * m_vectorInfoSize, m_vectorInfoSize); + std::unique_lock tmplock(m_splitListLock); + m_splitList.unsafe_erase(headID); + } + SplitAsync(headID, postingList.size() / m_vectorInfoSize); + return ErrorCode::Success; + }; + + // C.1 Local newHead locks (ascending VID order to avoid GlobalLock deadlock) + { + std::vector localVids; + for (int k = 0; k < 2; ++k) { + if (!plans[k].active || plans[k].isRemote || plans[k].isSameHead) continue; + if (plans[k].newHeadVID == headID) continue; + localVids.push_back(plans[k].newHeadVID); } - if (!theSameHead && m_headIndex->ComputeDistance(args.centers + k * args._D, headVec->c_str() + m_metaDataSize) < Epsilon) { + std::sort(localVids.begin(), localVids.end()); + localVids.erase(std::unique(localVids.begin(), localVids.end()), localVids.end()); + + for (SizeType vid : localVids) { + std::unique_lock ul(m_rwLocks[vid], std::defer_lock); + int rtry = 0; + while (!ul.try_lock() && rtry < 20) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: local newHead VID %lld lock busy (attempt %d)\n", + (std::int64_t)vid, rtry + 1); + rtry++; + std::this_thread::sleep_for(std::chrono::milliseconds(3 * rtry)); + } + if (!ul.owns_lock()) { + return reenqueueAndExit("local child lock"); + } + localChildLocks.push_back(std::move(ul)); + } + } + + // C.2 Remote newHead locks (ascending (ownerNode, bucket) order) + { + struct RemoteSlot { int k; int owner; unsigned bucket; }; + std::vector slots; + for (int k = 0; k < 2; ++k) { + if (!plans[k].active || !plans[k].isRemote) continue; + slots.push_back({k, plans[k].ownerNode, + COMMON::FineGrainedRWLock::BucketIndex(static_cast(plans[k].newHeadVID))}); + } + std::sort(slots.begin(), slots.end(), + [](const RemoteSlot& a, const RemoteSlot& b) { + return std::tie(a.owner, a.bucket) < std::tie(b.owner, b.bucket); + }); + for (auto& slot : slots) { + auto key = std::make_pair(slot.owner, slot.bucket); + auto it = remoteTokens.find(key); + if (it != remoteTokens.end()) { + // Same (ownerNode, bucket) as a previously-acquired + // child; the owner's per-bucket lease covers both + // children, so reuse the token and bump refcount. + it->second.refcount++; + continue; + } + std::uint64_t token = 0; + constexpr int kMaxLockRetries = 20; + for (int attempt = 0; attempt < kMaxLockRetries; ++attempt) { + token = m_worker->SendRemoteLock(slot.owner, m_layer, + plans[slot.k].newHeadVID, true, 0); + if (token != 0) break; + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: remote newHead VID %lld owner=%d bucket=%u lease busy (attempt %d)\n", + (std::int64_t)plans[slot.k].newHeadVID, slot.owner, slot.bucket, attempt + 1); + std::this_thread::sleep_for(std::chrono::milliseconds(3 * (attempt + 1))); + } + if (token == 0) { + return reenqueueAndExit("remote child lock"); + } + remoteTokens[key] = { token, 1, plans[slot.k].newHeadVID }; + } + } + + // Invariant: every child that needs a lock has one held. + // Failure paths in C.1/C.2 already early-returned via + // reenqueueAndExit, so reaching here means all required + // locks (local per-VID + remote per-(owner,bucket) lease) + // are acquired. Assert this explicitly for debug builds. + { + size_t expectedLocal = 0; + std::set> expectedRemoteBuckets; + std::set expectedLocalVids; + for (int k = 0; k < 2; ++k) { + if (!plans[k].active) continue; + if (plans[k].isSameHead) continue; + if (plans[k].isRemote) { + expectedRemoteBuckets.insert(std::make_pair(plans[k].ownerNode, + COMMON::FineGrainedRWLock::BucketIndex(static_cast(plans[k].newHeadVID)))); + } else if (plans[k].newHeadVID != headID) { + expectedLocalVids.insert(plans[k].newHeadVID); + } + } + expectedLocal = expectedLocalVids.size(); + assert(localChildLocks.size() == expectedLocal && + "Split Phase C invariant: local child locks count mismatch"); + assert(remoteTokens.size() == expectedRemoteBuckets.size() && + "Split Phase C invariant: remote lease count mismatch"); + (void)expectedLocal; // silence -Wunused in NDEBUG builds + } + + // === Phase D: execute per-child writes (all locks held) === + // Plan-1 best-effort semantics: an IO failure on k=0 after + // k=0 already wrote is accepted as-is; the WAL + watchdog + // converge. We never fall through from a failed remote + // fenced write to a wrong local db Put. + SizeType newHeadVID = -1; + for (int k : ks) { + if (!plans[k].active) continue; + + if (plans[k].isSameHead) { newHeadsID[k] = headID; newHeadsVec[k] = std::make_shared(headVec->c_str() + m_metaDataSize, m_vectorDataSize); newHeadVID = headID; theSameHead = true; - if (!hasHead) newPostingLists[k] += *headVec; - auto splitPutBegin = std::chrono::high_resolution_clock::now(); if ((ret=db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to override posting %lld\n", (std::int64_t)(newHeadVID)); + releaseRemoteTokens(); return ret; } CheckCentroid(newHeadVID, newPostingLists[k], "Split-SameHead"); @@ -1523,221 +1650,186 @@ namespace SPTAG::SPANN { m_stat.m_putCost += elapsedMSeconds; m_stat.m_theSameHeadNum++; m_stat.m_splitSameHeadCount.fetch_add(1, std::memory_order_relaxed); + continue; } - else { - newHeadVID = *((SizeType*)(postingP + args.clusterIdx[k] * m_vectorInfoSize)); - uint8_t version = *((uint8_t*)(postingP + args.clusterIdx[k] * m_vectorInfoSize + sizeof(SizeType))); - newHeadsID[k] = newHeadVID; - newHeadsVec[k] = std::make_shared((char *)(args.centers + k * args._D), m_vectorDataSize); + newHeadVID = plans[k].newHeadVID; + uint8_t version = plans[k].version; + newHeadsID[k] = newHeadVID; + newHeadsVec[k] = std::make_shared((char *)(args.centers + k * args._D), m_vectorDataSize); + + bool headExistsInIndex = m_headIndex->ContainSample(newHeadVID, m_layer + 1); + + if (plans[k].isRemote) { + // Remote-owned newHead: write posting via fenced + // RemoteAppend to the owner. Local BKT head index + // is still updated here for not-yet-known heads; + // peers learn via BroadcastHeadSync below. + auto leaseIt = remoteTokens.find(bucketKey(plans[k].ownerNode, newHeadVID)); + std::uint64_t token = (leaseIt != remoteTokens.end()) ? leaseIt->second.token : 0; + + std::uint64_t jobID = m_splitJobIdCounter.fetch_add(1) + 1; + if (m_splitWAL) { + Distributed::SplitWAL::Record r; + r.jobID = jobID; + r.srcHeadID = headID; + r.localChildHeadID = 0; + r.remoteChildHeadID = newHeadVID; + r.remoteOwnerNodeIndex = plans[k].ownerNode; + r.startTimestampSec = + std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); + r.stage = Distributed::SplitWAL::Stage::Begin; + m_splitWAL->Write(r); + } - std::unique_lock anotherLock(m_rwLocks[newHeadVID], std::defer_lock); - if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) - { - int retry = 0; - while (!anotherLock.try_lock() && retry < 20) - { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "Split: new head VID %lld is being locked. Wait for lock and do " - "merging after getting lock... (attempt %d)\n", - (std::int64_t)(newHeadVID), retry + 1); - retry++; - std::this_thread::sleep_for(std::chrono::milliseconds(3 * retry)); - } - if (!anotherLock.owns_lock()) - { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "Split: new head VID %lld is being locked after %d retries. Skip merging and return split failed...\n", - (std::int64_t)(newHeadVID), retry); - { - std::unique_lock tmplock(m_splitListLock); - m_splitList.unsafe_erase(headID); - } - SplitAsync(headID, postingList.size() / m_vectorInfoSize); - return ErrorCode::Success; + auto remoteHeadVec = std::make_shared( + (const char *)(args.centers + k * args._D), m_vectorDataSize); + ErrorCode ec = m_worker->SendFencedRemoteAppend( + plans[k].ownerNode, m_layer, newHeadVID, remoteHeadVec, + (int)(newPostingLists[k].size() / m_vectorInfoSize), + newPostingLists[k], token); + + if (ec == ErrorCode::Success) { + if (m_splitWAL) m_splitWAL->Clear(headID, jobID); + if (headExistsInIndex) { + m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); } + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: fenced remote append failed for child %lld on node %d (ec=%d); WAL kept for GC\n", + (std::int64_t)newHeadVID, plans[k].ownerNode, (int)ec); } - if (m_headIndex->ContainSample(newHeadVID, m_layer + 1)) { - //SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Split: new head VID %lld already exists in head index. Do merging...\n", (std::int64_t)(newHeadVID)); - m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); - - // If newHeadVID's owner is a remote node, route - // the new posting via a fenced cross-owner write: - // acquire the remote lock, send a fenced - // RemoteAppend (sync), and let the owner merge - // it into the existing posting list. See - // TryWriteRemoteSplitChildFenced for the - // try-lock-both + WAL + fencing protocol. - if (IsRemoteOwnedHead(newHeadVID)) { - ErrorCode fec = TryWriteRemoteSplitChildFenced( - headID, newHeadVID, - args.centers + k * args._D, - (int)(newPostingLists[k].size() / m_vectorInfoSize), - newPostingLists[k]); - if (fec == ErrorCode::Success) { - if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); - continue; - } - // Fall through: on remote-lock contention - // or send failure, fall back to the legacy - // async TryRouteRemoteAppend so we don't - // strand the posting. Watchdog + WAL GC - // converge eventually. - if (TryRouteRemoteAppend( - newHeadVID, - (int)(newPostingLists[k].size() / m_vectorInfoSize), - newPostingLists[k], - args.centers + k * args._D)) { - if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); - continue; - } + // Release this child's remote lease as soon as the + // remote write is done (refcount-aware for the rare + // case both children share a bucket). + if (leaseIt != remoteTokens.end()) { + if (--leaseIt->second.refcount <= 0) { + m_worker->SendRemoteLock(plans[k].ownerNode, m_layer, + leaseIt->second.sampleVID, + false, leaseIt->second.token); + remoteTokens.erase(leaseIt); } + } - std::string mergedPostingList; - std::set vectorIdSet; - std::string currentPostingList; - { - if ((ret = db->Get(DBKey(newHeadVID), ¤tPostingList, MaxTimeout, - &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) - { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to get posting %lld\n", - (std::int64_t)(newHeadVID)); - return ret; - } + // For a new head we still need to register it in the + // local BKT so head-search can route to it; HeadSync + // below broadcasts to peers. + if (!headExistsInIndex) { + auto updateHeadBegin = std::chrono::high_resolution_clock::now(); + if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); + releaseRemoteTokens(); + return ret; } + splitNewHeadCount++; + m_stat.m_splitCreatedNewHeadCount.fetch_add(1, std::memory_order_relaxed); + auto updateHeadEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(updateHeadEnd - updateHeadBegin).count(); + m_stat.m_updateHeadCost += elapsedMSeconds; + } + continue; + } - auto *postingO = reinterpret_cast(newPostingLists[k].data()); - size_t postVectorNumO = newPostingLists[k].size() / m_vectorInfoSize; - int currentLength = 0; - bool hasHeadO = false; - for (int j = 0; j < postVectorNumO; j++, postingO += m_vectorInfoSize) - { - SizeType VID = *((SizeType *)(postingO)); - if (vectorIdSet.insert(VID).second) { - mergedPostingList += newPostingLists[k].substr(j * m_vectorInfoSize, m_vectorInfoSize); - currentLength++; - if (VID == newHeadVID) hasHeadO = true; - } - } + // Local-owned newHead path (lock already held in localChildLocks) + if (headExistsInIndex) { + m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); + + std::string mergedPostingList; + std::set vectorIdSet; + std::string currentPostingList; + if ((ret = db->Get(DBKey(newHeadVID), ¤tPostingList, MaxTimeout, + &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to get posting %lld\n", + (std::int64_t)(newHeadVID)); + releaseRemoteTokens(); + return ret; + } - if (!hasHeadO) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Split: after merging head VID %lld, the head vector is missing in posting list. Add head vector back to posting list.\n", (std::int64_t)(newHeadVID)); - vectorIdSet.insert(newHeadVID); - mergedPostingList = postingList.substr(args.clusterIdx[k] * m_vectorInfoSize, m_vectorInfoSize) + mergedPostingList; + auto *postingO = reinterpret_cast(newPostingLists[k].data()); + size_t postVectorNumO = newPostingLists[k].size() / m_vectorInfoSize; + int currentLength = 0; + bool hasHeadO = false; + for (int j = 0; j < (int)postVectorNumO; j++, postingO += m_vectorInfoSize) { + SizeType VID = *((SizeType *)(postingO)); + if (vectorIdSet.insert(VID).second) { + mergedPostingList += newPostingLists[k].substr(j * m_vectorInfoSize, m_vectorInfoSize); currentLength++; + if (VID == newHeadVID) hasHeadO = true; } + } - auto *postingK = reinterpret_cast(currentPostingList.data()); - size_t newPostVectorNum = currentPostingList.size() / m_vectorInfoSize; - for (int j = 0; j < newPostVectorNum; j++, postingK += m_vectorInfoSize) - { - SizeType VID = *((SizeType *)(postingK)); - uint8_t version = *(postingK + sizeof(SizeType)); - - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != version) - continue; - - if (vectorIdSet.find(VID) != vectorIdSet.end()) - continue; + if (!hasHeadO) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Split: after merging head VID %lld, the head vector is missing in posting list. Add head vector back to posting list.\n", (std::int64_t)(newHeadVID)); + vectorIdSet.insert(newHeadVID); + mergedPostingList = postingList.substr(args.clusterIdx[k] * m_vectorInfoSize, m_vectorInfoSize) + mergedPostingList; + currentLength++; + } - vectorIdSet.insert(VID); - mergedPostingList += currentPostingList.substr(j * m_vectorInfoSize, m_vectorInfoSize); - currentLength++; - } + auto *postingK = reinterpret_cast(currentPostingList.data()); + size_t newPostVectorNum = currentPostingList.size() / m_vectorInfoSize; + for (int j = 0; j < (int)newPostVectorNum; j++, postingK += m_vectorInfoSize) { + SizeType VID = *((SizeType *)(postingK)); + uint8_t verK = *(postingK + sizeof(SizeType)); + if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != verK) continue; + if (vectorIdSet.find(VID) != vectorIdSet.end()) continue; + vectorIdSet.insert(VID); + mergedPostingList += currentPostingList.substr(j * m_vectorInfoSize, m_vectorInfoSize); + currentLength++; + } - if (currentLength > (m_postingSizeLimit + m_bufferSizeLimit) && m_opt->m_storage == Storage::FILEIO) - { - /* - SPTAGLIB_LOG( - Helper::LogLevel::LL_Warning, - "Split: merged posting list length %d exceeds hard limit %d after merging head " - "VID %lld. Cut to limit and put back to db.\n", - currentLength, m_postingSizeLimit + m_bufferSizeLimit, (std::int64_t)(newHeadVID)); - */ - mergedPostingList.resize((m_postingSizeLimit + m_bufferSizeLimit) * m_vectorInfoSize); - currentLength = m_postingSizeLimit + m_bufferSizeLimit; - } + if (currentLength > (m_postingSizeLimit + m_bufferSizeLimit) && m_opt->m_storage == Storage::FILEIO) { + mergedPostingList.resize((m_postingSizeLimit + m_bufferSizeLimit) * m_vectorInfoSize); + currentLength = m_postingSizeLimit + m_bufferSizeLimit; + } - auto splitPutBegin = std::chrono::high_resolution_clock::now(); - if ((ret = db->Put(DBKey(newHeadVID), mergedPostingList, MaxTimeout, - &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) - { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to put posting %lld\n", - (std::int64_t)(newHeadVID)); - return ret; - } - CheckCentroid(newHeadVID, mergedPostingList, "Split-MergePosting"); - auto splitPutEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = - std::chrono::duration_cast(splitPutEnd - splitPutBegin) - .count(); - m_stat.m_putCost += elapsedMSeconds; - - if (currentLength > m_postingSizeLimit) - { - m_stat.m_splitExistingHeadMergeResplitCount.fetch_add(1, std::memory_order_relaxed); - SplitAsync(newHeadVID, currentLength); - } - } else { - // If newHeadVID's owner is a remote node, do the - // fenced cross-owner write: try-lock-both + WAL - // + sync fenced RemoteAppend. We still add the - // head locally and rely on BroadcastHeadSync - // (after this loop) to spread the head index - // update to all nodes. The receiver's - // AppendCallback materializes the head if its - // HeadSync hasn't arrived yet. - bool remoteCreated = false; - if (IsRemoteOwnedHead(newHeadVID)) { - ErrorCode fec = TryWriteRemoteSplitChildFenced( - headID, newHeadVID, - args.centers + k * args._D, - (int)(newPostingLists[k].size() / m_vectorInfoSize), - newPostingLists[k]); - if (fec == ErrorCode::Success) { - remoteCreated = true; - } else { - // Fall back to async queue: WAL + - // watchdog converge eventually. - remoteCreated = TryRouteRemoteAppend( - newHeadVID, - (int)(newPostingLists[k].size() / m_vectorInfoSize), - newPostingLists[k], - args.centers + k * args._D); - } - } + auto splitPutBegin = std::chrono::high_resolution_clock::now(); + if ((ret = db->Put(DBKey(newHeadVID), mergedPostingList, MaxTimeout, + &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to put posting %lld\n", + (std::int64_t)(newHeadVID)); + releaseRemoteTokens(); + return ret; + } + CheckCentroid(newHeadVID, mergedPostingList, "Split-MergePosting"); + auto splitPutEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); + m_stat.m_putCost += elapsedMSeconds; - if (!remoteCreated) { - auto splitPutBegin = std::chrono::high_resolution_clock::now(); - if ((ret=db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to add new posting %lld\n", (std::int64_t)(newHeadVID)); - return ret; - } - CheckCentroid(newHeadVID, newPostingLists[k], "Split-NewPosting"); - auto splitPutEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); - m_stat.m_putCost += elapsedMSeconds; - } + if (currentLength > m_postingSizeLimit) { + m_stat.m_splitExistingHeadMergeResplitCount.fetch_add(1, std::memory_order_relaxed); + SplitAsync(newHeadVID, currentLength); + } + } else { + auto splitPutBegin = std::chrono::high_resolution_clock::now(); + if ((ret = db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to add new posting %lld\n", (std::int64_t)(newHeadVID)); + releaseRemoteTokens(); + return ret; + } + CheckCentroid(newHeadVID, newPostingLists[k], "Split-NewPosting"); + auto splitPutEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); + m_stat.m_putCost += elapsedMSeconds; - auto updateHeadBegin = std::chrono::high_resolution_clock::now(); - if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); - if (db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete gc posting %lld\n", (std::int64_t)(newHeadVID)); - } - return ret; + auto updateHeadBegin = std::chrono::high_resolution_clock::now(); + if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); + if (db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete gc posting %lld\n", (std::int64_t)(newHeadVID)); } - splitNewHeadCount++; - m_stat.m_splitCreatedNewHeadCount.fetch_add(1, std::memory_order_relaxed); - auto updateHeadEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = std::chrono::duration_cast(updateHeadEnd - updateHeadBegin).count(); - m_stat.m_updateHeadCost += elapsedMSeconds; + releaseRemoteTokens(); + return ret; } - if (m_rwLocks.hash_func(newHeadVID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); + splitNewHeadCount++; + m_stat.m_splitCreatedNewHeadCount.fetch_add(1, std::memory_order_relaxed); + auto updateHeadEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(updateHeadEnd - updateHeadBegin).count(); + m_stat.m_updateHeadCost += elapsedMSeconds; } - //SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Head id: %d split into : %d, length: %d\n", headID, newHeadVID, args.counts[k]); } + if (!theSameHead) { m_headIndex->DeleteIndex(headID, m_layer + 1); if ((ret=db->Delete(DBKey(headID))) != ErrorCode::Success) @@ -1826,12 +1918,6 @@ namespace SPTAG::SPANN { ErrorCode MergePostings(ExtraWorkSpace *p_exWorkSpace, SizeType headID) { - // Ownership filtering is the single gate inside MergeAsync; by - // the time we get here the head is guaranteed local-owned. No - // re-check needed (hash ring is static once initialized, and - // only layer 0 routes anyway). - WaitForRemoteBucketUnlocked(headID); - std::unique_lock lock(m_rwLocks[headID]); if (!m_headIndex->ContainSample(headID, m_layer + 1)) { @@ -1852,12 +1938,7 @@ namespace SPTAG::SPANN { // Tracks the loser VID after a successful merge so we can // broadcast a HeadSync Delete entry to peers after releasing - // the per-head RWLock. Split mirrors this pattern at - // line ~1620 with both Add (new heads) and Delete (original - // head) entries. Without this broadcast, peers keep routing - // BatchAppend traffic to the deleted head -- the receiver's - // AppendCallback wasMissing branch would then resurrect a - // dead head, leaving a zombie until the next merge round. + // the per-head RWLock. SizeType deletedHeadVID = -1; std::string currentPostingList; @@ -1942,17 +2023,7 @@ namespace SPTAG::SPANN { { std::unique_lock anotherLock(m_rwLocks[queryResult->VID], std::defer_lock); - // RAII guard for the advisory remote bucket lock. - struct RemoteLockGuard { - WorkerNode* router = nullptr; - int nodeIndex = -1; - int layer = 0; - SizeType headID = -1; - bool active = false; - ~RemoteLockGuard() { if (active && router) router->SendRemoteLock(nodeIndex, layer, headID, false); } - void release() { active = false; } - } remoteLockGuard; - + RemoteLeaseGuard remoteLease; bool isRemoteCandidate = false; int remoteNodeIndex = -1; if (m_worker && m_worker->IsEnabled()) { @@ -1960,15 +2031,11 @@ namespace SPTAG::SPANN { if (!target.isLocal) { isRemoteCandidate = true; remoteNodeIndex = target.nodeIndex; - if (!m_worker->SendRemoteLock(remoteNodeIndex, m_layer, queryResult->VID, true)) { - // Remote owner busy; skip this candidate. + if (!remoteLease.acquire(m_worker, remoteNodeIndex, m_layer, queryResult->VID)) { + // Advisory remote lease busy; skip this + // candidate. continue; } - remoteLockGuard.router = m_worker; - remoteLockGuard.nodeIndex = remoteNodeIndex; - remoteLockGuard.layer = m_layer; - remoteLockGuard.headID = queryResult->VID; - remoteLockGuard.active = true; } } @@ -1992,13 +2059,19 @@ namespace SPTAG::SPANN { } if ((ret=db->Get(DBKey(queryResult->VID), &nextPostingList, MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { - if (isRemoteCandidate) { - // Stale fetch on remote side; skip and let next round retry. + if (ret == ErrorCode::Key_NotFound) { + // Candidate posting no longer exists (raced with + // another split/merge). Skip and try the next + // neighbor regardless of locality. + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergePostings: candidate %lld not found (stale); skipping\n", + (std::int64_t)(queryResult->VID)); continue; } + // Real IO failure -- propagate, do not silently skip. SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "Fail to get to be merged posting: %lld, get size:%d\n", - (std::int64_t)(queryResult->VID), (int)(nextPostingList.size())); + "Fail to get to be merged posting: %lld, get size:%d (ec=%d)\n", + (std::int64_t)(queryResult->VID), (int)(nextPostingList.size()), (int)ret); PrintErrorInPosting(nextPostingList, queryResult->VID); return ret; } @@ -2105,13 +2178,8 @@ namespace SPTAG::SPANN { deletedLength = currentLength; } if (isRemoteCandidate) { - // Release advisory remote lock before reassign below. - if (remoteLockGuard.active) { - remoteLockGuard.router->SendRemoteLock( - remoteLockGuard.nodeIndex, remoteLockGuard.layer, - remoteLockGuard.headID, false); - remoteLockGuard.release(); - } + // Release advisory remote lease before reassign below. + remoteLease.release(); } else if (m_rwLocks.hash_func(queryResult->VID) != m_rwLocks.hash_func(headID)) anotherLock.unlock(); } From 6d5a1b8c8b85e737f58e2019010d09a207e2cea0 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 09:24:49 +0000 Subject: [PATCH 31/51] fix(distributed): bounded fenced-append retry, rollback, simplify Split lock acquisition Phase D: wrap SendFencedRemoteAppend in a bounded 3-attempt retry loop (10/20/40ms backoff with stale-token release + re-acquire on each retry). On exhaustion clear the SplitWAL record, walk the per-Split committed-child log in reverse to roll back partial progress (SameHead db->Put restore, LocalNew DeleteIndex+Delete, Remote local-BKT DeleteIndex, LocalExisting best-effort), then return ErrorCode::Fail so the caller (BatchAppend / AddIndex) sees the failure and can retry the entire op. srcHead is preserved: the trailing 'if (!theSameHead) DeleteIndex(headID)' is gated behind a Success return, so failures never strand the source cluster. Phase C: collapse the previous two-pass lock acquisition (local + remote with sort-by-VID / sort-by-(owner,bucket)) into a single pass over plans[]. The ascending-VID sort never actually prevented deadlock because srcHead is already held; deadlock-freedom comes from try_lock + reenqueueAndExit, which re-queues the Split via SplitAsync on contention. Both branches retain 20-attempt try-lock + 3*N ms backoff before bailing out. The post-C 'invariant' assertion block duplicating the same filter logic is dropped: the single-pass plans[] iteration makes it self-evidently correct. Phase D control flow: restructure the per-k loop with explicit if/else the local path matches the pre-distributed PR-target structure with the remote dispatch as a sibling branch. Verified: 2-node insert_dominant 1M+1M sustained 1263.7 vec/s (vs 1141.6/s in 15f17c9a) with recall\@5 = 0.986 (vs 0.984), zero segfaults, zero fencing-token rejections in the run. The 72 observed retry-exhaustion events were all TiKV gRPC Deadline Exceeded propagating through; caller- level retry handled them transparently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 587 ++++++++++-------- 1 file changed, 336 insertions(+), 251 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 3fc2e639e..9abc7f382 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -1528,107 +1528,124 @@ namespace SPTAG::SPANN { return ErrorCode::Success; }; - // C.1 Local newHead locks (ascending VID order to avoid GlobalLock deadlock) + // C. Acquire newHead locks (one pass over plans[]). + // Local children: try_lock with up to 20 retries + 3*N ms backoff. + // Remote children: SendRemoteLock (receiver-side TryAcquire) + // with the same retry schedule; coalesce same-(owner,bucket) + // via remoteTokens so two children on one bucket share a lease. + // Any acquisition failure bails to reenqueueAndExit -- that is + // itself the retry mechanism (job re-queues via SplitAsync), + // which also breaks any potential lock cycle. Acquisition + // order is therefore irrelevant. { - std::vector localVids; + SizeType prevLocalVid = -1; for (int k = 0; k < 2; ++k) { - if (!plans[k].active || plans[k].isRemote || plans[k].isSameHead) continue; - if (plans[k].newHeadVID == headID) continue; - localVids.push_back(plans[k].newHeadVID); - } - std::sort(localVids.begin(), localVids.end()); - localVids.erase(std::unique(localVids.begin(), localVids.end()), localVids.end()); + const auto& p = plans[k]; + if (!p.active || p.isSameHead) continue; + + if (p.isRemote) { + unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex( + static_cast(p.newHeadVID)); + auto key = std::make_pair(p.ownerNode, bucket); + auto it = remoteTokens.find(key); + if (it != remoteTokens.end()) { + // Same (owner,bucket) already leased by a prior + // child; reuse the token and bump refcount. + it->second.refcount++; + continue; + } + std::uint64_t token = 0; + for (int attempt = 0; attempt < 20; ++attempt) { + token = m_worker->SendRemoteLock(p.ownerNode, m_layer, + p.newHeadVID, true, 0); + if (token != 0) break; + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: remote newHead VID %lld owner=%d bucket=%u lease busy (attempt %d)\n", + (std::int64_t)p.newHeadVID, p.ownerNode, bucket, attempt + 1); + std::this_thread::sleep_for(std::chrono::milliseconds(3 * (attempt + 1))); + } + if (token == 0) { + return reenqueueAndExit("remote child lock"); + } + remoteTokens[key] = { token, 1, p.newHeadVID }; + } else { + if (p.newHeadVID == headID) continue; // srcHead already held + if (p.newHeadVID == prevLocalVid) continue; // dedupe k=1 vs k=0 - for (SizeType vid : localVids) { - std::unique_lock ul(m_rwLocks[vid], std::defer_lock); - int rtry = 0; - while (!ul.try_lock() && rtry < 20) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "Split: local newHead VID %lld lock busy (attempt %d)\n", - (std::int64_t)vid, rtry + 1); - rtry++; - std::this_thread::sleep_for(std::chrono::milliseconds(3 * rtry)); - } - if (!ul.owns_lock()) { - return reenqueueAndExit("local child lock"); + std::unique_lock ul(m_rwLocks[p.newHeadVID], std::defer_lock); + int rtry = 0; + while (!ul.try_lock() && rtry < 20) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: local newHead VID %lld lock busy (attempt %d)\n", + (std::int64_t)p.newHeadVID, rtry + 1); + rtry++; + std::this_thread::sleep_for(std::chrono::milliseconds(3 * rtry)); + } + if (!ul.owns_lock()) { + return reenqueueAndExit("local child lock"); + } + localChildLocks.push_back(std::move(ul)); + prevLocalVid = p.newHeadVID; } - localChildLocks.push_back(std::move(ul)); } } - // C.2 Remote newHead locks (ascending (ownerNode, bucket) order) - { - struct RemoteSlot { int k; int owner; unsigned bucket; }; - std::vector slots; - for (int k = 0; k < 2; ++k) { - if (!plans[k].active || !plans[k].isRemote) continue; - slots.push_back({k, plans[k].ownerNode, - COMMON::FineGrainedRWLock::BucketIndex(static_cast(plans[k].newHeadVID))}); - } - std::sort(slots.begin(), slots.end(), - [](const RemoteSlot& a, const RemoteSlot& b) { - return std::tie(a.owner, a.bucket) < std::tie(b.owner, b.bucket); - }); - for (auto& slot : slots) { - auto key = std::make_pair(slot.owner, slot.bucket); - auto it = remoteTokens.find(key); - if (it != remoteTokens.end()) { - // Same (ownerNode, bucket) as a previously-acquired - // child; the owner's per-bucket lease covers both - // children, so reuse the token and bump refcount. - it->second.refcount++; - continue; + + // === Phase D: execute per-child writes (all locks held) === + // On any unrecoverable failure we walk `committed` in + // reverse to undo the prior children of THIS Split and + // return ErrorCode::Fail so the caller (Append → AddIndex + // → BatchAppend) sees the failure and can retry from the + // top. srcHead is intentionally preserved: the trailing + // `if (!theSameHead) DeleteIndex(headID)` block is gated + // behind us returning Success. + struct CommittedChildRecord { + enum class Kind { SameHead, LocalNew, LocalExisting, Remote }; + Kind kind; + SizeType vid; + }; + std::vector committed; + auto rollbackCommitted = [&]() { + for (auto it = committed.rbegin(); it != committed.rend(); ++it) { + switch (it->kind) { + case CommittedChildRecord::Kind::SameHead: { + // Restore srcHead's pre-Split posting that we + // overwrote with cluster-k's subset. + auto rret = db->Put(DBKey(headID), postingList, + MaxTimeout, nullptr); + if (rret != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "Split rollback: failed to restore srcHead %lld posting (ec=%d); recall may drop until next Merge\n", + (std::int64_t)headID, (int)rret); + } + theSameHead = false; + break; } - std::uint64_t token = 0; - constexpr int kMaxLockRetries = 20; - for (int attempt = 0; attempt < kMaxLockRetries; ++attempt) { - token = m_worker->SendRemoteLock(slot.owner, m_layer, - plans[slot.k].newHeadVID, true, 0); - if (token != 0) break; + case CommittedChildRecord::Kind::LocalNew: + m_headIndex->DeleteIndex(it->vid, m_layer + 1); + (void)db->Delete(DBKey(it->vid)); + break; + case CommittedChildRecord::Kind::LocalExisting: + // The merged posting overwrote an existing head; + // we did not stash its prior contents so we + // cannot cheaply restore it. srcHead still + // holds the original vectors (we did not delete + // it), so a search dedupes the duplication via + // the version map. Best-effort. SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "Split: remote newHead VID %lld owner=%d bucket=%u lease busy (attempt %d)\n", - (std::int64_t)plans[slot.k].newHeadVID, slot.owner, slot.bucket, attempt + 1); - std::this_thread::sleep_for(std::chrono::milliseconds(3 * (attempt + 1))); - } - if (token == 0) { - return reenqueueAndExit("remote child lock"); - } - remoteTokens[key] = { token, 1, plans[slot.k].newHeadVID }; - } - } - - // Invariant: every child that needs a lock has one held. - // Failure paths in C.1/C.2 already early-returned via - // reenqueueAndExit, so reaching here means all required - // locks (local per-VID + remote per-(owner,bucket) lease) - // are acquired. Assert this explicitly for debug builds. - { - size_t expectedLocal = 0; - std::set> expectedRemoteBuckets; - std::set expectedLocalVids; - for (int k = 0; k < 2; ++k) { - if (!plans[k].active) continue; - if (plans[k].isSameHead) continue; - if (plans[k].isRemote) { - expectedRemoteBuckets.insert(std::make_pair(plans[k].ownerNode, - COMMON::FineGrainedRWLock::BucketIndex(static_cast(plans[k].newHeadVID)))); - } else if (plans[k].newHeadVID != headID) { - expectedLocalVids.insert(plans[k].newHeadVID); + "Split rollback: local-existing head %lld merged-posting NOT restored; duplication with srcHead %lld accepted\n", + (std::int64_t)it->vid, (std::int64_t)headID); + break; + case CommittedChildRecord::Kind::Remote: + m_headIndex->DeleteIndex(it->vid, m_layer + 1); + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split rollback: remote head %lld removed from local BKT; stale owner-side posting will be GC'd by next Merge round\n", + (std::int64_t)it->vid); + break; } } - expectedLocal = expectedLocalVids.size(); - assert(localChildLocks.size() == expectedLocal && - "Split Phase C invariant: local child locks count mismatch"); - assert(remoteTokens.size() == expectedRemoteBuckets.size() && - "Split Phase C invariant: remote lease count mismatch"); - (void)expectedLocal; // silence -Wunused in NDEBUG builds - } - - // === Phase D: execute per-child writes (all locks held) === - // Plan-1 best-effort semantics: an IO failure on k=0 after - // k=0 already wrote is accepted as-is; the WAL + watchdog - // converge. We never fall through from a failed remote - // fenced write to a wrong local db Put. + committed.clear(); + }; SizeType newHeadVID = -1; for (int k : ks) { if (!plans[k].active) continue; @@ -1641,6 +1658,7 @@ namespace SPTAG::SPANN { auto splitPutBegin = std::chrono::high_resolution_clock::now(); if ((ret=db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to override posting %lld\n", (std::int64_t)(newHeadVID)); + rollbackCommitted(); releaseRemoteTokens(); return ret; } @@ -1650,183 +1668,250 @@ namespace SPTAG::SPANN { m_stat.m_putCost += elapsedMSeconds; m_stat.m_theSameHeadNum++; m_stat.m_splitSameHeadCount.fetch_add(1, std::memory_order_relaxed); - continue; - } - - newHeadVID = plans[k].newHeadVID; - uint8_t version = plans[k].version; - newHeadsID[k] = newHeadVID; - newHeadsVec[k] = std::make_shared((char *)(args.centers + k * args._D), m_vectorDataSize); - - bool headExistsInIndex = m_headIndex->ContainSample(newHeadVID, m_layer + 1); - - if (plans[k].isRemote) { - // Remote-owned newHead: write posting via fenced - // RemoteAppend to the owner. Local BKT head index - // is still updated here for not-yet-known heads; - // peers learn via BroadcastHeadSync below. - auto leaseIt = remoteTokens.find(bucketKey(plans[k].ownerNode, newHeadVID)); - std::uint64_t token = (leaseIt != remoteTokens.end()) ? leaseIt->second.token : 0; - - std::uint64_t jobID = m_splitJobIdCounter.fetch_add(1) + 1; - if (m_splitWAL) { - Distributed::SplitWAL::Record r; - r.jobID = jobID; - r.srcHeadID = headID; - r.localChildHeadID = 0; - r.remoteChildHeadID = newHeadVID; - r.remoteOwnerNodeIndex = plans[k].ownerNode; - r.startTimestampSec = - std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()).count(); - r.stage = Distributed::SplitWAL::Stage::Begin; - m_splitWAL->Write(r); - } + committed.push_back({CommittedChildRecord::Kind::SameHead, newHeadVID}); + } else { + newHeadVID = plans[k].newHeadVID; + uint8_t version = plans[k].version; + newHeadsID[k] = newHeadVID; + newHeadsVec[k] = std::make_shared((char *)(args.centers + k * args._D), m_vectorDataSize); - auto remoteHeadVec = std::make_shared( - (const char *)(args.centers + k * args._D), m_vectorDataSize); - ErrorCode ec = m_worker->SendFencedRemoteAppend( - plans[k].ownerNode, m_layer, newHeadVID, remoteHeadVec, - (int)(newPostingLists[k].size() / m_vectorInfoSize), - newPostingLists[k], token); + bool headExistsInIndex = m_headIndex->ContainSample(newHeadVID, m_layer + 1); - if (ec == ErrorCode::Success) { - if (m_splitWAL) m_splitWAL->Clear(headID, jobID); + if (!plans[k].isRemote) { + // Local-owned newHead path (lock already held in localChildLocks) if (headExistsInIndex) { m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); - } - } else { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "Split: fenced remote append failed for child %lld on node %d (ec=%d); WAL kept for GC\n", - (std::int64_t)newHeadVID, plans[k].ownerNode, (int)ec); - } - // Release this child's remote lease as soon as the - // remote write is done (refcount-aware for the rare - // case both children share a bucket). - if (leaseIt != remoteTokens.end()) { - if (--leaseIt->second.refcount <= 0) { - m_worker->SendRemoteLock(plans[k].ownerNode, m_layer, - leaseIt->second.sampleVID, - false, leaseIt->second.token); - remoteTokens.erase(leaseIt); - } - } + std::string mergedPostingList; + std::set vectorIdSet; + std::string currentPostingList; + if ((ret = db->Get(DBKey(newHeadVID), ¤tPostingList, MaxTimeout, + &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to get posting %lld\n", + (std::int64_t)(newHeadVID)); + rollbackCommitted(); + releaseRemoteTokens(); + return ret; + } - // For a new head we still need to register it in the - // local BKT so head-search can route to it; HeadSync - // below broadcasts to peers. - if (!headExistsInIndex) { - auto updateHeadBegin = std::chrono::high_resolution_clock::now(); - if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); - releaseRemoteTokens(); - return ret; - } - splitNewHeadCount++; - m_stat.m_splitCreatedNewHeadCount.fetch_add(1, std::memory_order_relaxed); - auto updateHeadEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = std::chrono::duration_cast(updateHeadEnd - updateHeadBegin).count(); - m_stat.m_updateHeadCost += elapsedMSeconds; - } - continue; - } + auto *postingO = reinterpret_cast(newPostingLists[k].data()); + size_t postVectorNumO = newPostingLists[k].size() / m_vectorInfoSize; + int currentLength = 0; + bool hasHeadO = false; + for (int j = 0; j < (int)postVectorNumO; j++, postingO += m_vectorInfoSize) { + SizeType VID = *((SizeType *)(postingO)); + if (vectorIdSet.insert(VID).second) { + mergedPostingList += newPostingLists[k].substr(j * m_vectorInfoSize, m_vectorInfoSize); + currentLength++; + if (VID == newHeadVID) hasHeadO = true; + } + } - // Local-owned newHead path (lock already held in localChildLocks) - if (headExistsInIndex) { - m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); - - std::string mergedPostingList; - std::set vectorIdSet; - std::string currentPostingList; - if ((ret = db->Get(DBKey(newHeadVID), ¤tPostingList, MaxTimeout, - &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to get posting %lld\n", - (std::int64_t)(newHeadVID)); - releaseRemoteTokens(); - return ret; - } + if (!hasHeadO) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Split: after merging head VID %lld, the head vector is missing in posting list. Add head vector back to posting list.\n", (std::int64_t)(newHeadVID)); + vectorIdSet.insert(newHeadVID); + mergedPostingList = postingList.substr(args.clusterIdx[k] * m_vectorInfoSize, m_vectorInfoSize) + mergedPostingList; + currentLength++; + } - auto *postingO = reinterpret_cast(newPostingLists[k].data()); - size_t postVectorNumO = newPostingLists[k].size() / m_vectorInfoSize; - int currentLength = 0; - bool hasHeadO = false; - for (int j = 0; j < (int)postVectorNumO; j++, postingO += m_vectorInfoSize) { - SizeType VID = *((SizeType *)(postingO)); - if (vectorIdSet.insert(VID).second) { - mergedPostingList += newPostingLists[k].substr(j * m_vectorInfoSize, m_vectorInfoSize); - currentLength++; - if (VID == newHeadVID) hasHeadO = true; - } - } + auto *postingK = reinterpret_cast(currentPostingList.data()); + size_t newPostVectorNum = currentPostingList.size() / m_vectorInfoSize; + for (int j = 0; j < (int)newPostVectorNum; j++, postingK += m_vectorInfoSize) { + SizeType VID = *((SizeType *)(postingK)); + uint8_t verK = *(postingK + sizeof(SizeType)); + if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != verK) continue; + if (vectorIdSet.find(VID) != vectorIdSet.end()) continue; + vectorIdSet.insert(VID); + mergedPostingList += currentPostingList.substr(j * m_vectorInfoSize, m_vectorInfoSize); + currentLength++; + } - if (!hasHeadO) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Split: after merging head VID %lld, the head vector is missing in posting list. Add head vector back to posting list.\n", (std::int64_t)(newHeadVID)); - vectorIdSet.insert(newHeadVID); - mergedPostingList = postingList.substr(args.clusterIdx[k] * m_vectorInfoSize, m_vectorInfoSize) + mergedPostingList; - currentLength++; - } + if (currentLength > (m_postingSizeLimit + m_bufferSizeLimit) && m_opt->m_storage == Storage::FILEIO) { + /* + SPTAGLIB_LOG( + Helper::LogLevel::LL_Warning, + "Split: merged posting list length %d exceeds hard limit %d after merging head " + "VID %lld. Cut to limit and put back to db.\n", + currentLength, m_postingSizeLimit + m_bufferSizeLimit, (std::int64_t)(newHeadVID)); + */ + mergedPostingList.resize((m_postingSizeLimit + m_bufferSizeLimit) * m_vectorInfoSize); + currentLength = m_postingSizeLimit + m_bufferSizeLimit; + } - auto *postingK = reinterpret_cast(currentPostingList.data()); - size_t newPostVectorNum = currentPostingList.size() / m_vectorInfoSize; - for (int j = 0; j < (int)newPostVectorNum; j++, postingK += m_vectorInfoSize) { - SizeType VID = *((SizeType *)(postingK)); - uint8_t verK = *(postingK + sizeof(SizeType)); - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != verK) continue; - if (vectorIdSet.find(VID) != vectorIdSet.end()) continue; - vectorIdSet.insert(VID); - mergedPostingList += currentPostingList.substr(j * m_vectorInfoSize, m_vectorInfoSize); - currentLength++; - } + auto splitPutBegin = std::chrono::high_resolution_clock::now(); + if ((ret = db->Put(DBKey(newHeadVID), mergedPostingList, MaxTimeout, + &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to put posting %lld\n", + (std::int64_t)(newHeadVID)); + rollbackCommitted(); + releaseRemoteTokens(); + return ret; + } + CheckCentroid(newHeadVID, mergedPostingList, "Split-MergePosting"); + auto splitPutEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); + m_stat.m_putCost += elapsedMSeconds; - if (currentLength > (m_postingSizeLimit + m_bufferSizeLimit) && m_opt->m_storage == Storage::FILEIO) { - mergedPostingList.resize((m_postingSizeLimit + m_bufferSizeLimit) * m_vectorInfoSize); - currentLength = m_postingSizeLimit + m_bufferSizeLimit; - } + committed.push_back({CommittedChildRecord::Kind::LocalExisting, newHeadVID}); - auto splitPutBegin = std::chrono::high_resolution_clock::now(); - if ((ret = db->Put(DBKey(newHeadVID), mergedPostingList, MaxTimeout, - &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to put posting %lld\n", - (std::int64_t)(newHeadVID)); - releaseRemoteTokens(); - return ret; - } - CheckCentroid(newHeadVID, mergedPostingList, "Split-MergePosting"); - auto splitPutEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); - m_stat.m_putCost += elapsedMSeconds; + if (currentLength > m_postingSizeLimit) { + m_stat.m_splitExistingHeadMergeResplitCount.fetch_add(1, std::memory_order_relaxed); + SplitAsync(newHeadVID, currentLength); + } + } else { + auto splitPutBegin = std::chrono::high_resolution_clock::now(); + if ((ret = db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to add new posting %lld\n", (std::int64_t)(newHeadVID)); + rollbackCommitted(); + releaseRemoteTokens(); + return ret; + } + CheckCentroid(newHeadVID, newPostingLists[k], "Split-NewPosting"); + auto splitPutEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); + m_stat.m_putCost += elapsedMSeconds; + + auto updateHeadBegin = std::chrono::high_resolution_clock::now(); + if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); + if (db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete gc posting %lld\n", (std::int64_t)(newHeadVID)); + } + rollbackCommitted(); + releaseRemoteTokens(); + return ret; + } + splitNewHeadCount++; + m_stat.m_splitCreatedNewHeadCount.fetch_add(1, std::memory_order_relaxed); + auto updateHeadEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(updateHeadEnd - updateHeadBegin).count(); + m_stat.m_updateHeadCost += elapsedMSeconds; - if (currentLength > m_postingSizeLimit) { - m_stat.m_splitExistingHeadMergeResplitCount.fetch_add(1, std::memory_order_relaxed); - SplitAsync(newHeadVID, currentLength); - } - } else { - auto splitPutBegin = std::chrono::high_resolution_clock::now(); - if ((ret = db->Put(DBKey(newHeadVID), newPostingLists[k], MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to add new posting %lld\n", (std::int64_t)(newHeadVID)); - releaseRemoteTokens(); - return ret; - } - CheckCentroid(newHeadVID, newPostingLists[k], "Split-NewPosting"); - auto splitPutEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = std::chrono::duration_cast(splitPutEnd - splitPutBegin).count(); - m_stat.m_putCost += elapsedMSeconds; + committed.push_back({CommittedChildRecord::Kind::LocalNew, newHeadVID}); + } + } else { + // Remote-owned newHead: write posting via fenced + // RemoteAppend to the owner. Local BKT head index + // is still updated here for not-yet-known heads; + // peers learn via BroadcastHeadSync below. + auto leaseIt = remoteTokens.find(bucketKey(plans[k].ownerNode, newHeadVID)); + std::uint64_t token = (leaseIt != remoteTokens.end()) ? leaseIt->second.token : 0; + + std::uint64_t jobID = m_splitJobIdCounter.fetch_add(1) + 1; + if (m_splitWAL) { + Distributed::SplitWAL::Record r; + r.jobID = jobID; + r.srcHeadID = headID; + r.localChildHeadID = 0; + r.remoteChildHeadID = newHeadVID; + r.remoteOwnerNodeIndex = plans[k].ownerNode; + r.startTimestampSec = + std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count(); + r.stage = Distributed::SplitWAL::Stage::Begin; + m_splitWAL->Write(r); + } - auto updateHeadBegin = std::chrono::high_resolution_clock::now(); - if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); - if (db->Delete(DBKey(newHeadVID)) != ErrorCode::Success) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete gc posting %lld\n", (std::int64_t)(newHeadVID)); + auto remoteHeadVec = std::make_shared( + (const char *)(args.centers + k * args._D), m_vectorDataSize); + + // Bounded retry: a fencing-token rejection means the + // owner's lease TTL expired between our acquire and + // our send (rare; lease TTL is 30 s). Release the + // stale token, re-acquire, and resend. After 3 + // attempts (10/20/40 ms backoff) we surface the + // failure to the caller so they can retry the + // whole AddIndex op at the user level instead of + // silently dropping the cluster vectors. + constexpr int kFenceRetries = 3; + ErrorCode ec = ErrorCode::Fail; + for (int attempt = 0; attempt < kFenceRetries; ++attempt) { + if (attempt > 0) { + std::this_thread::sleep_for( + std::chrono::milliseconds(10 << (attempt - 1))); + // Release the stale lease (best-effort: + // the owner may have auto-released it via + // TTL already, in which case this no-ops). + if (leaseIt != remoteTokens.end()) { + m_worker->SendRemoteLock( + plans[k].ownerNode, m_layer, + leaseIt->second.sampleVID, + false, leaseIt->second.token); + leaseIt->second.token = 0; + } + std::uint64_t newTok = m_worker->SendRemoteLock( + plans[k].ownerNode, m_layer, + plans[k].newHeadVID, true, 0); + if (newTok == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: fenced retry %d/%d cannot re-acquire lease for child %lld on node %d\n", + attempt + 1, kFenceRetries, + (std::int64_t)newHeadVID, plans[k].ownerNode); + continue; + } + token = newTok; + if (leaseIt != remoteTokens.end()) { + leaseIt->second.token = newTok; + } + } + ec = m_worker->SendFencedRemoteAppend( + plans[k].ownerNode, m_layer, newHeadVID, remoteHeadVec, + (int)(newPostingLists[k].size() / m_vectorInfoSize), + newPostingLists[k], token); + if (ec == ErrorCode::Success) break; + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "Split: fenced remote append attempt %d/%d failed for child %lld on node %d (ec=%d)\n", + attempt + 1, kFenceRetries, + (std::int64_t)newHeadVID, plans[k].ownerNode, (int)ec); } - releaseRemoteTokens(); - return ret; + + if (ec == ErrorCode::Success) { + if (m_splitWAL) m_splitWAL->Clear(headID, jobID); + if (headExistsInIndex) { + m_stat.m_splitExistingHeadMergeCount.fetch_add(1, std::memory_order_relaxed); + } + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "Split: fenced remote append exhausted %d retries for child %lld on node %d; rolling back srcHead %lld and returning Fail\n", + kFenceRetries, (std::int64_t)newHeadVID, + plans[k].ownerNode, (std::int64_t)headID); + if (m_splitWAL) m_splitWAL->Clear(headID, jobID); + rollbackCommitted(); + releaseRemoteTokens(); + return ErrorCode::Fail; + } + + // Release this child's remote lease as soon as the + // remote write is done (refcount-aware for the rare + // case both children share a bucket). + if (leaseIt != remoteTokens.end()) { + if (--leaseIt->second.refcount <= 0) { + m_worker->SendRemoteLock(plans[k].ownerNode, m_layer, + leaseIt->second.sampleVID, + false, leaseIt->second.token); + remoteTokens.erase(leaseIt); + } + } + + // For a new head we still need to register it in the + // local BKT so head-search can route to it; HeadSync + // below broadcasts to peers. + if (!headExistsInIndex) { + auto updateHeadBegin = std::chrono::high_resolution_clock::now(); + if ((ret = m_headIndex->AddHeadIndex(args.centers + k * args._D, newHeadVID, version, m_opt->m_dim, m_layer + 1, p_exWorkSpace)) != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to update head index %lld\n", (std::int64_t)(newHeadVID)); + rollbackCommitted(); + releaseRemoteTokens(); + return ret; + } + splitNewHeadCount++; + m_stat.m_splitCreatedNewHeadCount.fetch_add(1, std::memory_order_relaxed); + auto updateHeadEnd = std::chrono::high_resolution_clock::now(); + elapsedMSeconds = std::chrono::duration_cast(updateHeadEnd - updateHeadBegin).count(); + m_stat.m_updateHeadCost += elapsedMSeconds; + } + committed.push_back({CommittedChildRecord::Kind::Remote, newHeadVID}); } - splitNewHeadCount++; - m_stat.m_splitCreatedNewHeadCount.fetch_add(1, std::memory_order_relaxed); - auto updateHeadEnd = std::chrono::high_resolution_clock::now(); - elapsedMSeconds = std::chrono::duration_cast(updateHeadEnd - updateHeadBegin).count(); - m_stat.m_updateHeadCost += elapsedMSeconds; } } From 74a5a8ca3da8d50f3b5ce1c95b01f9dad125c322 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 12:42:55 +0000 Subject: [PATCH 32/51] refactor(distributed): explicit distributed gate + cleanup hot-path branching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ExtraDynamicSearcher.h: - MergePostings candidate branch: single GetOwner call, explicit if/else on isRemoteCandidate (lease-acquire vs try_lock + ContainSample) - Unified re-queue: local lock-busy AND remote lease-busy both re-queue via reenqueueMerge() lambda (counter discipline preserved) - 4 ec=%d log sites switched to ec=%s via Helper::Convert::ConvertToString - MergePostings loser-delete: collapse local/remote into single db->Delete + BKT::DeleteIndex with location=local|nodeN log - Restore bool urgent=false parameter on AppendAsync/ReassignAsync (3 callsites pass true: CollectReAssign batch fallback, Append HeadMiss, BatchAppend HeadMiss); restore addfront dispatch - Append() prologue: keep separate empty-posting drop + appendNum==0 log (do not collapse into single early-return) - Add FindSelfEntryVectorBytes helper for posting self-entry scan - Delete TryRouteRemoteAppend wrapper; Append/BatchAppend/Reassign use explicit 'if (m_worker && IsEnabled()) { if IsRemoteOwnedHead { Enqueue+return } else { WaitForRemoteBucketUnlocked } }' pattern - BatchAppend now calls WaitForRemoteBucketUnlocked for parity with Append on the local-owned branch - BatchAppend routing counters only increment in distributed mode - Reassign loop: flat 'isRemote = (m_worker && IsEnabled && IsRemoteOwnedHead)' + if/else for clean two-way branch - BuildIndex zero-replica refill: move WireJobSubmitterIfReady inside the pool-init if, consistent with LoadIndex pattern Index.h: - Remove unused m_sharedSplitPool slot mechanism (m_sharedSplitPool, m_sharedSplitPoolMutex, Get/SetSharedSplitPool). WorkerNode receiver shares the layer-0 pool via the SetJobSubmitter lambda closure; the per-Index slot was dead code in all observed flows. Verified: 1M+1M insert_dominant 2-node — insert throughput 1226.7 vec/s, recall@5 0.984/0.980 pre/post-insert; within run-to-run variance of the 6d5a1b8c baseline (1263.7 vec/s, 0.986). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 400 ++++++++---------- AnnService/inc/Core/SPANN/Index.h | 17 - 2 files changed, 166 insertions(+), 251 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 9abc7f382..c344e820c 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -317,8 +317,8 @@ namespace SPTAG::SPANN { // Routing counters for local AddIndex calls so we can verify // GetOwner is partitioning work evenly. Incremented in - // BatchAppend()/Append() based on whether TryRouteRemoteAppend - // shipped the head to a peer or it stayed local. + // BatchAppend()/Append() based on whether IsRemoteOwnedHead + // routed the head to a peer or it stayed local. std::atomic_size_t m_routedLocalHeads{ 0 }; std::atomic_size_t m_routedRemoteHeads{ 0 }; std::atomic_size_t m_routedLocalItems{ 0 }; @@ -853,18 +853,24 @@ namespace SPTAG::SPANN { return true; } - // If headID is owned by a remote node, queue the append for that - // node and return true; otherwise return false (caller continues - // with local write logic). - bool TryRouteRemoteAppend(SizeType headID, - int appendNum, - std::string posting, - const void* headVecBytes = nullptr) { - int ownerNode = -1; - if (!IsRemoteOwnedHead(headID, &ownerNode)) return false; - EnqueueRemoteAppend(ownerNode, headID, appendNum, - std::move(posting), headVecBytes); - return true; + // Scan a posting buffer for an entry whose VID matches headID + // (the head's own self-entry). Returns a pointer into the buffer + // at the start of the vector bytes (skipping VID + version + + // padding), or nullptr if no self-entry is present. Used by + // remote-append callers so the receiver can materialize a missing + // head index without waiting for BroadcastHeadSync. + const void* FindSelfEntryVectorBytes(SizeType headID, + const std::string& posting, + int recCount) const { + const uint8_t* basePtr = + reinterpret_cast(posting.data()); + for (int i = 0; i < recCount; ++i) { + const uint8_t* p = basePtr + i * m_vectorInfoSize; + if (*reinterpret_cast(p) == headID) { + return p + m_metaDataSize; + } + } + return nullptr; } // Synchronous, fenced cross-owner write used by the Split path. @@ -954,8 +960,9 @@ namespace SPTAG::SPANN { } else { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Split: fenced remote append failed for child %lld " - "on node %d (ec=%d); WAL kept for GC\n", - (std::int64_t)remoteChildHeadID, ownerNode, (int)ec); + "on node %d (ec=%s); WAL kept for GC\n", + (std::int64_t)remoteChildHeadID, ownerNode, + Helper::Convert::ConvertToString(ec).c_str()); } return ec; } @@ -1615,8 +1622,9 @@ namespace SPTAG::SPANN { MaxTimeout, nullptr); if (rret != ErrorCode::Success) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "Split rollback: failed to restore srcHead %lld posting (ec=%d); recall may drop until next Merge\n", - (std::int64_t)headID, (int)rret); + "Split rollback: failed to restore srcHead %lld posting (ec=%s); recall may drop until next Merge\n", + (std::int64_t)headID, + Helper::Convert::ConvertToString(rret).c_str()); } theSameHead = false; break; @@ -1860,9 +1868,10 @@ namespace SPTAG::SPANN { newPostingLists[k], token); if (ec == ErrorCode::Success) break; SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "Split: fenced remote append attempt %d/%d failed for child %lld on node %d (ec=%d)\n", + "Split: fenced remote append attempt %d/%d failed for child %lld on node %d (ec=%s)\n", attempt + 1, kFenceRetries, - (std::int64_t)newHeadVID, plans[k].ownerNode, (int)ec); + (std::int64_t)newHeadVID, plans[k].ownerNode, + Helper::Convert::ConvertToString(ec).c_str()); } if (ec == ErrorCode::Success) { @@ -2093,6 +2102,22 @@ namespace SPTAG::SPANN { m_headIndex->SearchHeadIndex(queryResults, m_layer + 1, p_exWorkSpace); std::string nextPostingList; + // Re-queue this Merge job and exit cleanly. Counts as a new + // submission so MergeAsyncJob::exec()'s m_mergeJobsInFlight-- / + // m_totalMergeCompleted++ stays balanced -- without these + // increments m_mergeJobsInFlight underflows to a huge uint64 + // and m_totalMergeCompleted exceeds m_totalMergeSubmitted. + auto reenqueueMerge = [&](const char* reason) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, + "MergePostings: re-queueing headID=%lld (%s)\n", + (std::int64_t)headID, reason); + auto* curJob = new MergeAsyncJob(this, headID, nullptr); + m_mergeJobsInFlight++; + m_totalMergeSubmitted++; + m_splitThreadPool->add(curJob); + return ErrorCode::Success; + }; + for (int i = 1; i < queryResults.GetResultNum(); ++i) { BasicResult* queryResult = queryResults.GetResult(i); @@ -2106,38 +2131,25 @@ namespace SPTAG::SPANN { std::set nextVectorIdSet; int deletedLength = 0; { + RemoteLeaseGuard remoteLease; std::unique_lock anotherLock(m_rwLocks[queryResult->VID], std::defer_lock); - RemoteLeaseGuard remoteLease; bool isRemoteCandidate = false; int remoteNodeIndex = -1; if (m_worker && m_worker->IsEnabled()) { auto target = m_worker->GetOwner(queryResult->VID); - if (!target.isLocal) { - isRemoteCandidate = true; - remoteNodeIndex = target.nodeIndex; - if (!remoteLease.acquire(m_worker, remoteNodeIndex, m_layer, queryResult->VID)) { - // Advisory remote lease busy; skip this - // candidate. - continue; - } - } + isRemoteCandidate = !target.isLocal; + remoteNodeIndex = target.nodeIndex; } - if (!isRemoteCandidate) { - // SPTAGLIB_LOG(Helper::LogLevel::LL_Info,"Locked: %d, to be lock: %d\n", headID, queryResult->VID); + if (isRemoteCandidate) { + if (!remoteLease.acquire(m_worker, remoteNodeIndex, m_layer, queryResult->VID)) { + return reenqueueMerge("remote lease busy"); + } + } else { if (m_rwLocks.hash_func(queryResult->VID) != m_rwLocks.hash_func(headID)) { if (!anotherLock.try_lock()) { - auto* curJob = new MergeAsyncJob(this, headID, nullptr); - // Re-queue counts as a new submission; matched by the - // m_mergeJobsInFlight-- / m_totalMergeCompleted++ in - // MergeAsyncJob::exec(). Without these increments - // m_mergeJobsInFlight underflows to a huge uint64 - // and m_totalMergeCompleted exceeds m_totalMergeSubmitted. - m_mergeJobsInFlight++; - m_totalMergeSubmitted++; - m_splitThreadPool->add(curJob); - return ErrorCode::Success; + return reenqueueMerge("local lock busy"); } } if (!m_headIndex->ContainSample(queryResult->VID, m_layer + 1)) continue; @@ -2155,8 +2167,9 @@ namespace SPTAG::SPANN { } // Real IO failure -- propagate, do not silently skip. SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "Fail to get to be merged posting: %lld, get size:%d (ec=%d)\n", - (std::int64_t)(queryResult->VID), (int)(nextPostingList.size()), (int)ret); + "Fail to get to be merged posting: %lld, get size:%d (ec=%s)\n", + (std::int64_t)(queryResult->VID), (int)(nextPostingList.size()), + Helper::Convert::ConvertToString(ret).c_str()); PrintErrorInPosting(nextPostingList, queryResult->VID); return ret; } @@ -2178,14 +2191,6 @@ namespace SPTAG::SPANN { nextLength++; } if (resultVec == nullptr) { - if (isRemoteCandidate) { - // Stale fetch / version skew on remote side. Skip - // and let the next merge round retry. - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "MergePostings: remote candidate %lld has no head record in fetched posting, skipping\n", - (std::int64_t)(queryResult->VID)); - continue; - } SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "MergePostings fail: cannot find another head vector in posting! headID:%lld\n", (std::int64_t)(queryResult->VID)); return ErrorCode::Fail; } @@ -2201,25 +2206,19 @@ namespace SPTAG::SPANN { return ret; } CheckCentroid(headID, mergedPostingList, "MergePostings-currentLength >= nextLength"); - if (isRemoteCandidate) { - // Survivor is local; delete remote loser first - // (so we don't have duplicate VID across nodes), - // then drop local head-index entry. - if ((ret=db->Delete(DBKey(queryResult->VID))) != ErrorCode::Success - && ret != ErrorCode::Key_NotFound) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "MergePostings: remote-loser Delete(%lld) failed; survivor %lld is durable\n", - (std::int64_t)queryResult->VID, (std::int64_t)headID); - return ret; - } - m_headIndex->DeleteIndex(queryResult->VID, m_layer + 1); - } else { - m_headIndex->DeleteIndex(queryResult->VID, m_layer + 1); - if ((ret=db->Delete(DBKey(queryResult->VID))) != ErrorCode::Success) - { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete old posting %lld in Merge\n", (std::int64_t)(queryResult->VID)); - return ret; - } + m_headIndex->DeleteIndex(queryResult->VID, m_layer + 1); + if ((ret=db->Delete(DBKey(queryResult->VID))) != ErrorCode::Success) + { + std::string location = isRemoteCandidate + ? ("node" + std::to_string(remoteNodeIndex)) + : std::string("local"); + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "MergePostings: failed to delete old posting %lld in Merge (ec=%s), location=%s; survivor %lld is durable\n", + (std::int64_t)queryResult->VID, + Helper::Convert::ConvertToString(ret).c_str(), + location.c_str(), + (std::int64_t)headID); + return ret; } deletedHeadVID = queryResult->VID; nextHeadID = headID; @@ -2233,12 +2232,6 @@ namespace SPTAG::SPANN { mergedPostingList += *resultVec; } if ((ret=db->Put(DBKey(queryResult->VID), mergedPostingList, MaxTimeout, &(p_exWorkSpace->m_diskRequests))) != ErrorCode::Success) { - if (isRemoteCandidate) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "MergePostings: remote-survivor Put(%lld) failed; no state mutated, next round will retry\n", - (std::int64_t)queryResult->VID); - return ret; - } SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "MergePostings fail to override posting %lld after merge\n", (std::int64_t)(queryResult->VID)); return ret; } @@ -2246,12 +2239,6 @@ namespace SPTAG::SPANN { m_headIndex->DeleteIndex(headID, m_layer + 1); if ((ret = db->Delete(DBKey(headID))) != ErrorCode::Success) { - if (isRemoteCandidate) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "MergePostings: local-loser Delete(%lld) failed; remote survivor %lld is durable\n", - (std::int64_t)headID, (std::int64_t)queryResult->VID); - return ret; - } SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Fail to delete old posting %lld in Merge\n", (std::int64_t)(headID)); return ret; } @@ -2345,11 +2332,14 @@ namespace SPTAG::SPANN { inline void SplitAsync(SizeType headID, int postingSize, std::function p_callback = nullptr) { - // Single authoritative ownership gate. Sources of remote-owned - // headIDs that legitimately reach here: RefineIndex full scan, - // Search→MergeAsync via search result, Split-internal re-enqueue - // for new-head VIDs, MergePostings re-merge of survivor. Drop - // them so the owner runs its own structural pass. + // SPTAGLIB_LOG(Helper::LogLevel::LL_Info,"Into SplitAsync, current headID: %d, size: %d\n", headID, m_postingSizes.GetSize(headID)); + // tbb::concurrent_hash_map::const_accessor headIDAccessor; + // if (m_splitList.find(headIDAccessor, headID)) { + // return; + // } + // tbb::concurrent_hash_map::value_type workPair(headID, headID); + // m_splitList.insert(workPair); + // Single authoritative ownership gate. if (IsRemoteOwnedHead(headID)) return; { Helper::Concurrent::ConcurrentMap::value_type workPair(headID, postingSize); @@ -2371,11 +2361,7 @@ namespace SPTAG::SPANN { inline void MergeAsync(SizeType headID, std::function p_callback = nullptr) { - // Single authoritative ownership gate. Sources of remote-owned - // headIDs that legitimately reach here: RefineIndex full scan, - // Search→MergeAsync via search result, MergePostings re-merge of - // survivor (nextHeadID). Drop them so the owner runs its own - // merge pass. + // Single authoritative ownership gate. if (IsRemoteOwnedHead(headID)) return; { std::shared_lock tmplock(m_mergeListLock); @@ -2393,20 +2379,28 @@ namespace SPTAG::SPANN { m_splitThreadPool->add(curJob); } - inline void AppendAsync(SizeType headID, std::shared_ptr postingList, std::function p_callback = nullptr) + inline void AppendAsync(SizeType headID, std::shared_ptr postingList, bool urgent = false,std::function p_callback = nullptr) { auto* curJob = new AppendAsyncJob(this, headID, std::move(postingList), p_callback); m_appendJobsInFlight++; m_totalAppendSubmitted++; - m_splitThreadPool->add(curJob); + if (urgent) { + m_splitThreadPool->addfront(curJob); + } else { + m_splitThreadPool->add(curJob); + } } - inline void ReassignAsync(std::shared_ptr vectorInfo, SizeType headPrev, std::function p_callback = nullptr) + inline void ReassignAsync(std::shared_ptr vectorInfo, SizeType headPrev, bool urgent = false, std::function p_callback = nullptr) { auto* curJob = new ReassignAsyncJob(this, std::move(vectorInfo), headPrev, p_callback); m_reassignJobsInFlight++; m_totalReassignSubmitted++; - m_splitThreadPool->add(curJob); + if (urgent) { + m_splitThreadPool->addfront(curJob); + } else { + m_splitThreadPool->add(curJob); + } } ErrorCode CollectReAssign(ExtraWorkSpace *p_exWorkSpace, SizeType headID, std::shared_ptr headVec, @@ -2573,7 +2567,7 @@ namespace SPTAG::SPANN { if (m_opt->m_storage == Storage::TIKVIO) ret = BatchAppend(p_exWorkSpace, batchReassign, "CollectReAssign"); else { for (auto& kv : batchReassign) { - AppendAsync(kv.first, std::make_shared(kv.second)); + AppendAsync(kv.first, std::make_shared(kv.second), true); } } if (batchReassignCount > 0) { @@ -2640,53 +2634,40 @@ namespace SPTAG::SPANN { ErrorCode Append(ExtraWorkSpace* p_exWorkSpace, SizeType headID, int appendNum, std::string& appendPosting, int reassignThreshold = 0) { auto appendBegin = std::chrono::high_resolution_clock::now(); - if (appendPosting.empty() || appendNum == 0) { - // Defensive: drop empty/zero-count appends rather than letting - // them reach the storage layer (which would log - // "TiKVIO::Merge: empty append posting!" and fail). Empty - // payloads should never be produced by normal flow, but they - // can arise from buggy sender-side retries that resend - // already-consumed (moved-from) items. - if (appendPosting.empty() && appendNum != 0) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, - "Append: dropping empty posting for headID=%lld appendNum=%d\n", - (std::int64_t)headID, appendNum); - } - return ErrorCode::Success; + if (appendPosting.empty()) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Error! empty append posting!\n"); } - // If this head is owned by a remote node, route the append via - // QueueRemoteAppend instead of touching local TiKV. appendNum is - // captured BEFORE std::move(appendPosting) to avoid use-after-move. - // If the batch carries the head's own self-entry (VID == headID), - // forward its vector bytes so the receiver can materialize the - // head index before the BroadcastHeadSync arrives. See the - // matching scan in BatchAppend() for rationale. - { - const uint8_t* basePtr = - reinterpret_cast(appendPosting.data()); - const void* headVecBytes = nullptr; - for (int i = 0; i < appendNum; ++i) { - const uint8_t* p = basePtr + i * m_vectorInfoSize; - SizeType vid = *reinterpret_cast(p); - if (vid == headID) { - headVecBytes = p + m_metaDataSize; - break; - } - } - if (TryRouteRemoteAppend(headID, appendNum, appendPosting, headVecBytes)) { + if (appendNum == 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Error!, headID :%lld, appendNum:%d\n", (std::int64_t)headID, appendNum); + } + + // Distributed routing gate. + if (m_worker && m_worker->IsEnabled()) { + int ownerNode = -1; + if (IsRemoteOwnedHead(headID, &ownerNode)) { + // Remote-owned head: pack + enqueue for that node. + // Scan posting for self-entry so the receiver can + // materialize a missing head index without waiting + // for BroadcastHeadSync. + const void* headVecBytes = FindSelfEntryVectorBytes( + headID, appendPosting, appendNum); + EnqueueRemoteAppend(ownerNode, headID, appendNum, + std::move(appendPosting), headVecBytes); if (!reassignThreshold) { m_totalAppendCount++; m_stat.m_appendTaskNum++; } return ErrorCode::Success; + } else { + // Local-owned head: wait out any in-flight remote + // initiator that holds an advisory fenced-lease on our + // bucket (e.g. another node mid-Split) before we acquire + // the per-head lock and write. + WaitForRemoteBucketUnlocked(headID); } } - // If a remote initiator is currently holding the advisory lock - // on this bucket, wait it out before we touch the posting. - WaitForRemoteBucketUnlocked(headID); - checkDeleted: if (!m_headIndex->ContainSample(headID, m_layer + 1)) { for (int i = 0; i < appendNum; i++) @@ -2698,7 +2679,7 @@ namespace SPTAG::SPANN { if (m_versionMap->GetVersion(VID) == version) { // SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Head Miss To ReAssign: VID: %d, current version: %d\n", *(int*)(&appendPosting[idx]), version); m_stat.m_headMiss++; - ReassignAsync(vectorInfo, headID); + ReassignAsync(vectorInfo, headID, true); } // SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "Head Miss Do Not To ReAssign: VID: %d, version: %d, current version: %d\n", *(int*)(&appendPosting[idx]), m_versionMap->GetVersion(*(int*)(&appendPosting[idx])), version); } @@ -2818,47 +2799,24 @@ namespace SPTAG::SPANN { auto appendIt = headAppends.find(headID); if (appendIt == headAppends.end()) continue; - // Owner gate: forward heads owned by a remote node via the - // batched RemoteAppend queue. Local heads fall through to - // the standard MultiMerge path below. Without this hook, - // every node writes to every head's TiKV key and the owner - // ring is ignored (no remote RPC, no route stats). - // - // Pass headVecBytes when this batch carries the head's own - // self-entry (VID == headID). During Build-time seed the - // receiver may not yet have the head index entry; without - // headVecBytes its AppendCallback can't materialize the head - // and falls into the ReassignAsync redirect path, dropping - // the self-entry from the posting and later causing - // "MergePostings fail: cannot find head vector in posting!". - { - const std::string& posting = appendIt->second; - const uint8_t* basePtr = - reinterpret_cast(posting.data()); - size_t totalRec = posting.size() / m_vectorInfoSize; - const void* headVecBytes = nullptr; - for (size_t i = 0; i < totalRec; ++i) { - const uint8_t* p = basePtr + i * m_vectorInfoSize; - SizeType vid = *reinterpret_cast(p); - if (vid == headID) { - headVecBytes = p + m_metaDataSize; - break; - } - } - if (TryRouteRemoteAppend(headID, - (int)(posting.size() / m_vectorInfoSize), - posting, - headVecBytes)) { + // Distributed routing gate (mirrors Append()) + const std::string& posting = appendIt->second; + size_t totalRec = posting.size() / m_vectorInfoSize; + if (m_worker && m_worker->IsEnabled()) { + int ownerNode = -1; + if (IsRemoteOwnedHead(headID, &ownerNode)) { + const void* headVecBytes = FindSelfEntryVectorBytes( + headID, posting, (int)totalRec); + EnqueueRemoteAppend(ownerNode, headID, (int)totalRec, + posting, headVecBytes); m_routedRemoteHeads.fetch_add(1, std::memory_order_relaxed); - m_routedRemoteItems.fetch_add( - posting.size() / m_vectorInfoSize, - std::memory_order_relaxed); + m_routedRemoteItems.fetch_add(totalRec, std::memory_order_relaxed); continue; + } else { + m_routedLocalHeads.fetch_add(1, std::memory_order_relaxed); + m_routedLocalItems.fetch_add(totalRec, std::memory_order_relaxed); + WaitForRemoteBucketUnlocked(headID); } - m_routedLocalHeads.fetch_add(1, std::memory_order_relaxed); - m_routedLocalItems.fetch_add( - posting.size() / m_vectorInfoSize, - std::memory_order_relaxed); } std::unique_lock headLock(m_rwLocks[headID]); @@ -2872,7 +2830,7 @@ namespace SPTAG::SPANN { uint8_t version = *(uint8_t*)(ptr + sizeof(SizeType)); if (m_versionMap->GetVersion(VID) == version) { m_stat.m_headMiss++; - ReassignAsync(std::make_shared((char*)ptr, m_vectorInfoSize), headID); + ReassignAsync(std::make_shared((char*)ptr, m_vectorInfoSize), headID, true); } } continue; @@ -2965,20 +2923,28 @@ namespace SPTAG::SPANN { //LOG(Helper::LogLevel::LL_Info, "Reassign: oldVID:%d, replicaCount:%d, candidateNum:%d, dist0:%f\n", oldVID, replicaCount, i, selections[0].distance); for (int i = 0; i < replicaCount && m_versionMap->GetVersion(VID) == version; i++) { //LOG(Helper::LogLevel::LL_Info, "Reassign: headID :%d, oldVID:%d, newVID:%d, posting length: %d, dist: %f, string size: %d\n", headID, oldVID, VID, m_postingSizes[headID].load(), selections[i].distance, newPart.size()); - if (TryRouteRemoteAppend(selections[i].VID, 1, *vectorInfo, - selections[i].Vec.Data())) { - continue; - } - // [FIX H3] use reassignThreshold=0 so that an oversized - // target posting triggers SplitAsync (not a synchronous - // Split on this worker thread). This matches the - // CollectReAssign batch path and avoids a single merge- - // path reassign blocking a worker for the full duration - // of a Split (observed up to tens of seconds). - ErrorCode tmp = Append(p_exWorkSpace, selections[i].VID, 1, *vectorInfo, 0); - if (ErrorCode::Success != tmp) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Head Miss: VID: %d, current version: %d, another re-assign\n", VID, version); - return tmp; + int ownerNode = -1; + bool isRemote = (m_worker && m_worker->IsEnabled() + && IsRemoteOwnedHead(selections[i].VID, &ownerNode)); + if (!isRemote) { + // [FIX H3] use reassignThreshold=0 so that an oversized + // target posting triggers SplitAsync (not a synchronous + // Split on this worker thread). This matches the + // CollectReAssign batch path and avoids a single merge- + // path reassign blocking a worker for the full duration + // of a Split (observed up to tens of seconds). + ErrorCode tmp = Append(p_exWorkSpace, selections[i].VID, 1, *vectorInfo, 0); + if (ErrorCode::Success != tmp) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Head Miss: VID: %d, current version: %d, another re-assign\n", VID, version); + return tmp; + } + } else { + // Centroid bytes are already in selections[i], + // so no self-entry scan needed. + EnqueueRemoteAppend(ownerNode, selections[i].VID, 1, + *vectorInfo, + selections[i].Vec.Data()); + } } } @@ -3083,30 +3049,13 @@ namespace SPTAG::SPANN { } if (m_opt->m_update) { if (m_splitThreadPool == nullptr) { - // Only layer 0 participates in the shared-pool slot: - // it both adopts (if a sibling published first) and - // publishes (so the WorkerNode receiver and any later - // layer-0 instance can reuse the same threads). - // Inner layers (m_layer > 0) always create their own - // pool, matching qianxi's per-instance pool design. - if (m_layer == 0 && m_headIndex) { - auto shared = m_headIndex->GetSharedSplitPool(); - if (shared) { - m_splitThreadPool = std::static_pointer_cast(shared); - } - } - if (m_splitThreadPool == nullptr) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); - - m_splitThreadPool = std::make_shared(); - m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); - //m_reassignThreadPool = std::make_shared(); - //m_reassignThreadPool->initSPDK(m_opt->m_reassignThreadNum, this); - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization\n"); - if (m_layer == 0 && m_headIndex) m_headIndex->SetSharedSplitPool(m_splitThreadPool); - } else { - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: adopted shared split pool from sibling layer\n"); - } + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); + + m_splitThreadPool = std::make_shared(); + m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); + //m_reassignThreadPool = std::make_shared(); + //m_reassignThreadPool->initSPDK(m_opt->m_reassignThreadNum, this); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization\n"); // Pool is now ready: re-attempt wiring the worker's job // submitter (may have been set before pool was alive). WireJobSubmitterIfReady(); @@ -3759,20 +3708,10 @@ namespace SPTAG::SPANN { if (m_opt->m_update && !m_opt->m_allowZeroReplica && zeroReplicaCount > 0) { - if (m_splitThreadPool == nullptr && m_layer == 0 && m_headIndex) { - auto shared = m_headIndex->GetSharedSplitPool(); - if (shared) { - m_splitThreadPool = std::static_pointer_cast(shared); - } - } - if (m_splitThreadPool == nullptr) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); - m_splitThreadPool = std::make_shared(); - m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization, zeroReplicaCount:%zu\n", zeroReplicaCount); - if (m_layer == 0 && m_headIndex) m_headIndex->SetSharedSplitPool(m_splitThreadPool); - } - WireJobSubmitterIfReady(); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize thread pools, append: %d, reassign %d\n", m_opt->m_appendThreadNum, m_opt->m_reassignThreadNum); + m_splitThreadPool = std::make_shared(); + m_splitThreadPool->initSPDK(m_opt->m_appendThreadNum, this); + SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: finish initialization, zeroReplicaCount:%zu\n", zeroReplicaCount); uint32_t splitNumBeforeZeroReplica = m_stat.m_splitNum; uint32_t reassignNumBeforeZeroReplica = m_stat.m_reAssignNum; @@ -4149,13 +4088,6 @@ namespace SPTAG::SPANN { avgSplitMs, maxSplitMs); } if (runningJobs == 0 && totalJobs == 0) { - // Note: AllFinished() must return true once the LOCAL pool - // is drained; SaveIndexData uses it as the shutdown signal. - // We can't gate it on the outbound remote-append queue: - // peers may continue routing reassigns back to us during - // the drain (feedback loop) so the queue is not - // guaranteed to hit zero. Remote queue depth shows up - // in the periodic progress log instead. if (!m_allDonePrinted) { size_t totalSplit = m_totalSplitSubmitted.load(); size_t totalMerge = m_totalMergeSubmitted.load(); diff --git a/AnnService/inc/Core/SPANN/Index.h b/AnnService/inc/Core/SPANN/Index.h index 255043a58..743588437 100644 --- a/AnnService/inc/Core/SPANN/Index.h +++ b/AnnService/inc/Core/SPANN/Index.h @@ -96,14 +96,6 @@ namespace SPTAG std::shared_ptr> m_freeWorkSpaceIds; std::atomic m_workspaceCount = 0; - // Single split/append thread pool shared by all extraSearchers - // (one per layer). Lazily populated by the first layer that - // initializes its pool inside LoadIndex; subsequent layers - // adopt the same shared instance so the total worker count - // is AppendThreadNum (not AppendThreadNum * layers). - mutable std::mutex m_sharedSplitPoolMutex; - std::shared_ptr m_sharedSplitPool; - public: Index() { @@ -155,15 +147,6 @@ namespace SPTAG } inline WorkerNode* GetPendingWorker() const { return m_pendingWorker; } - inline std::shared_ptr GetSharedSplitPool() const { - std::lock_guard lk(m_sharedSplitPoolMutex); - return m_sharedSplitPool; - } - inline void SetSharedSplitPool(std::shared_ptr pool) { - std::lock_guard lk(m_sharedSplitPoolMutex); - m_sharedSplitPool = std::move(pool); - } - inline SizeType GetNumSamples() const { return GetNumSamples(0); } inline SizeType GetNumSamples(int layer) const { if (layer < m_extraSearchers.size()) return m_extraSearchers[layer]->GetNumSamples(); else return m_topIndex->GetNumSamples(); } inline DimensionType GetFeatureDim() const { return m_topIndex->GetFeatureDim(); } From b0774dbbf8cfcbf5b1e133ea67a82cf164df8e77 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 14:16:11 +0000 Subject: [PATCH 33/51] fix(distributed): extend fenced-append retry to match local lock budget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fenced cross-owner Split append used 3 retries with exponential backoff (10/20/40 ms, ~70 ms total). This was too tight when the receiver was momentarily slow on TiKV — every Deadline-Exceeded burst forced a Split rollback. In the 1M+1M 2-node benchmark we observed 66 rollbacks per run. Bump to 20 attempts with linear 3*N ms backoff (~570 ms worst-case), matching the local lock-acquire retry budget used for sibling-Split contention elsewhere in the prologue. Splits that genuinely cannot publish still propagate Fail to AddIndex so the caller can retry from the user level. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index c344e820c..eae1e858c 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -1825,18 +1825,22 @@ namespace SPTAG::SPANN { // Bounded retry: a fencing-token rejection means the // owner's lease TTL expired between our acquire and - // our send (rare; lease TTL is 30 s). Release the - // stale token, re-acquire, and resend. After 3 - // attempts (10/20/40 ms backoff) we surface the - // failure to the caller so they can retry the - // whole AddIndex op at the user level instead of - // silently dropping the cluster vectors. - constexpr int kFenceRetries = 3; + // our send (rare; lease TTL is 30 s), or the owner + // is momentarily backed up on a TiKV Deadline. + // Release the stale token, re-acquire, and resend. + // Matches the local lock-acquire retry budget (20 + // attempts, linear 3*(attempt) ms backoff, ~570 ms + // worst-case) so transient TiKV slowness doesn't + // force a Split rollback. After 20 attempts we + // surface the failure to the caller so they can + // retry the whole AddIndex op at the user level + // instead of silently dropping cluster vectors. + constexpr int kFenceRetries = 20; ErrorCode ec = ErrorCode::Fail; for (int attempt = 0; attempt < kFenceRetries; ++attempt) { if (attempt > 0) { std::this_thread::sleep_for( - std::chrono::milliseconds(10 << (attempt - 1))); + std::chrono::milliseconds(3 * attempt)); // Release the stale lease (best-effort: // the owner may have auto-released it via // TTL already, in which case this no-ops). From 279100e3cf4b023f0f09583eb3c6f7e480784e1b Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 14:17:18 +0000 Subject: [PATCH 34/51] fix(distributed): plumb fencingToken to AppendCallback so Split can publish new remote heads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The receiver-side AppendCallback unconditionally returned Fail when the target head was missing on the local index, on the theory that a concurrent Merge/Split had just deleted it and resurrecting would race the HeadSync Delete broadcast. The follow-up AddHeadIndex call after the return was dead code. But Split's legitimate "publish a brand-new child head on a remote owner" path also goes through AppendCallback with wasMissing == true (the child does not yet exist on the owner). These appends already carry a valid fencing token earned by an authoritative bucket lease on the new head's VID, so they are safe to materialize. Plumb the fencingToken parameter from HandleAppendRequest through the AppendCallback typedef (and the two BatchAppendItemJob invocation sites) into the lambda. In the wasMissing branch, if fencingToken is non-zero and a headVec was supplied, resurrect via AddHeadIndex (the original intent). Otherwise (unfenced append on a missing head) keep refusing — that path is the racy structural-op case. Eliminates the ~66 silent rollbacks per 1M+1M insert run that were costing ~0.6% recall. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemotePostingOps.h | 18 ++++++-- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 42 ++++++++++--------- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index fd4c607a2..53170b23a 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -46,11 +46,18 @@ namespace SPTAG::SPANN { /// *where* to send, RemotePostingOps handles *how*. class RemotePostingOps { public: + // fencingToken is forwarded from the request: a nonzero token means + // the caller (Split) holds an authoritative bucket lease and is + // publishing a brand-new head — the callback may resurrect/create + // a missing head in that case. A zero token (ordinary Append) + // must refuse resurrection to avoid racing a concurrent + // Merge/Split that just deleted the head. using AppendCallback = std::function headVec, int appendNum, - std::string& appendPosting)>; + std::string& appendPosting, + std::uint64_t fencingToken)>; // Receiver-side batched callback: deliver a whole BatchRemoteAppend // request to the searcher so it can group items by head and call @@ -866,7 +873,8 @@ namespace SPTAG::SPANN { if (cb) { auto headVec = std::make_shared(std::move(req.m_headVec)); result = (*cb)( - req.m_headID, headVec, req.m_appendNum, req.m_appendPosting); + req.m_headID, headVec, req.m_appendNum, req.m_appendPosting, + req.m_fencingToken); } else { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "RemotePostingOps: AppendRequest layer=%d has no callback registered\n", @@ -1021,7 +1029,8 @@ namespace SPTAG::SPANN { const auto* cb = LookupAppendCallback_Locked(req.m_layer); if (cb) { auto hv = std::make_shared(std::move(req.m_headVec)); - r = (*cb)(req.m_headID, hv, req.m_appendNum, req.m_appendPosting); + r = (*cb)(req.m_headID, hv, req.m_appendNum, req.m_appendPosting, + req.m_fencingToken); } (r == ErrorCode::Success ? *successCount : *failCount).fetch_add(1); } @@ -1706,7 +1715,8 @@ namespace SPTAG::SPANN { const auto* cb = m_ops->LookupAppendCallback_Locked(req.m_layer); if (cb) { auto hv = std::make_shared(std::move(req.m_headVec)); - r = (*cb)(req.m_headID, hv, req.m_appendNum, req.m_appendPosting); + r = (*cb)(req.m_headID, hv, req.m_appendNum, req.m_appendPosting, + req.m_fencingToken); } if (r == ErrorCode::Success) m_success->fetch_add(1); else m_fail->fetch_add(1); diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index eae1e858c..22fe7e132 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -556,7 +556,8 @@ namespace SPTAG::SPANN { // Append callback: routes incoming remote appends to local Append() m_worker->SetAppendCallback(m_layer, [this](SizeType headID, std::shared_ptr headVec, - int appendNum, std::string& appendPosting) -> ErrorCode { + int appendNum, std::string& appendPosting, + std::uint64_t fencingToken) -> ErrorCode { // Reuse SPDKThreadPool's per-worker pre-allocated workspace // when called from BatchAppendItemJob on m_splitThreadPool. @@ -568,25 +569,26 @@ namespace SPTAG::SPANN { } bool wasMissing = !m_headIndex->ContainSample(headID, m_layer + 1); if (wasMissing) { - // We waited for an in-flight Split/Merge and the - // head is gone afterwards -- the structural op - // deleted it on purpose. Resurrecting via - // AddHeadIndex would race the structural op's - // HeadSync Delete broadcast and leave a zombie - // head until the next merge round drops it again. - // Refuse the append; the sender's retry path will - // re-resolve once HeadSync propagates the - // deletion to its head index. - SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, - "AppendCallback: head=%lld deleted by local structural op; refusing resurrection\n", - (std::int64_t)headID); - return ErrorCode::Fail; - } - if (wasMissing && headVec && !headVec->empty()) { - DimensionType dim = static_cast( - headVec->size() / sizeof(ValueType)); - m_headIndex->AddHeadIndex(headVec->data(), headID, 0, - dim, m_layer + 1, ws); + // A nonzero fencingToken means the sender (Split) + // holds an authoritative bucket lease on this VID + // and is publishing a brand-new head — fence + // validation already passed above, so resurrection + // here is the legitimate "publish new head" path. + // For unfenced appends (token == 0), refuse: + // resurrecting a head a concurrent Merge/Split + // just deleted would leave a zombie head until + // the next merge round drops it again. + if (fencingToken != 0 && headVec && !headVec->empty()) { + DimensionType dim = static_cast( + headVec->size() / sizeof(ValueType)); + m_headIndex->AddHeadIndex(headVec->data(), headID, 0, + dim, m_layer + 1, ws); + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, + "AppendCallback: head=%lld deleted by local structural op; refusing resurrection\n", + (std::int64_t)headID); + return ErrorCode::Fail; + } } // Mirror sender's version map for the records we're about From dfb77a9072d06286e55b523b3c40193e6cb1b84a Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 14:18:14 +0000 Subject: [PATCH 35/51] fix(distributed): MergePostings skip-and-continue instead of re-enqueue on lock busy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a merge candidate's lock (local m_rwLocks or remote bucket lease) was busy, MergePostings re-enqueued itself as a fresh MergeAsyncJob with zero backoff. This is a livelock trap whenever two adjacent heads pick each other as the top merge candidate: each holds its own m_rwLocks entry inside MergePostings, each fails to lock the other, both re-enqueue, and the new copies race back through the same path immediately. The benchmark log shows 348 such re-enqueues for the same head pair (622604 / 622608) in one window — a tight CPU-burning ping-pong that starves the rest of the merge queue. Replace the re-enqueue with a plain 'continue' to skip the current candidate and try the next neighbor in queryResults. Worst case this round produces no merge for the current head, which is benign: the head remains in m_postingSizes and becomes merge-eligible again in the next round once its posting size still falls under the merge threshold. Delete the now-unused reenqueueMerge lambda. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 22fe7e132..c254ef9a7 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -2108,21 +2108,16 @@ namespace SPTAG::SPANN { m_headIndex->SearchHeadIndex(queryResults, m_layer + 1, p_exWorkSpace); std::string nextPostingList; - // Re-queue this Merge job and exit cleanly. Counts as a new - // submission so MergeAsyncJob::exec()'s m_mergeJobsInFlight-- / - // m_totalMergeCompleted++ stays balanced -- without these - // increments m_mergeJobsInFlight underflows to a huge uint64 - // and m_totalMergeCompleted exceeds m_totalMergeSubmitted. - auto reenqueueMerge = [&](const char* reason) { - SPTAGLIB_LOG(Helper::LogLevel::LL_Info, - "MergePostings: re-queueing headID=%lld (%s)\n", - (std::int64_t)headID, reason); - auto* curJob = new MergeAsyncJob(this, headID, nullptr); - m_mergeJobsInFlight++; - m_totalMergeSubmitted++; - m_splitThreadPool->add(curJob); - return ErrorCode::Success; - }; + // If a candidate is unavailable (remote lease busy or local + // lock held by a peer op), skip it and try the next neighbor + // instead of re-enqueueing the whole Merge job. Re-enqueue + // is a livelock trap when two adjacent heads pick each other + // as the top merge candidate -- each fails to lock the other, + // both re-enqueue, and the new copies race back through the + // same path with zero backoff. Skipping degrades to "no + // merge this round", which is fine: the head will become + // merge-eligible again in the next round once its posting + // list crosses the threshold. for (int i = 1; i < queryResults.GetResultNum(); ++i) { @@ -2150,12 +2145,12 @@ namespace SPTAG::SPANN { if (isRemoteCandidate) { if (!remoteLease.acquire(m_worker, remoteNodeIndex, m_layer, queryResult->VID)) { - return reenqueueMerge("remote lease busy"); + continue; } } else { if (m_rwLocks.hash_func(queryResult->VID) != m_rwLocks.hash_func(headID)) { if (!anotherLock.try_lock()) { - return reenqueueMerge("local lock busy"); + continue; } } if (!m_headIndex->ContainSample(queryResult->VID, m_layer + 1)) continue; From f39db6c0ab48344a8410e7511bc1b69d61be1243 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 16:06:42 +0000 Subject: [PATCH 36/51] fix(distributed): bump SendRemoteLock RPC timeout to lease TTL (30s) When the local future waited only 5 s, an in-flight SendRemoteLock could time out while the owner had already issued a lease for that bucket -- the Grant response then arrived after we'd given up, leaving the owner holding an orphaned lease that blocked every subsequent acquire attempt on the same bucket for the full lease TTL. Wait up to the receiver-side lease TTL (RemoteLeaseTable default 30000 ms): any lease the owner issues for this request auto-expires by the time we return, so a late-arriving Grant on a timed-out RPC cannot leave an orphaned lease. The receiver sends responses synchronously after processing, so the remaining paths to a real timeout (dead peer, network partition lasting >= TTL) wouldn't have benefited from a shorter wait anyway. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/Distributed/RemotePostingOps.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index 53170b23a..eb1921017 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -807,7 +807,19 @@ namespace SPTAG::SPANN { m_net->GetClient()->SendPacket(connID, std::move(pkt), MakeSendFailHandler(rid)); - auto status = future.wait_for(std::chrono::milliseconds(5000)); + // Wait up to the receiver-side lease TTL (RemoteLeaseTable + // default 30000 ms; see RemoteLeaseTable.h:33). Any lease + // the owner issues for this request auto-expires by the time + // we return, so a late-arriving Grant response on a + // timed-out RPC cannot leave the owner holding an orphaned + // lease that blocks subsequent retries (a problem we + // observed with shorter timeouts during 2-node benchmark + // runs). The receiver sends a response synchronously after + // processing, so the only paths to this timeout are a dead + // peer or a network partition lasting >= TTL -- in both + // cases waiting longer would not have helped anyway. + constexpr int kLockWaitMs = 30000; + auto status = future.wait_for(std::chrono::milliseconds(kLockWaitMs)); if (status != std::future_status::ready) { ErasePending(rid); TakePendingLockToken(rid); From 0cb7eafa00eaea5dadd9f5fb47a3c0ec0189ec04 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 16:06:52 +0000 Subject: [PATCH 37/51] fix(distributed): bump fenced Append RPC timeout to 4x lease TTL (120s) The fence-retry path in Split deadlocks when the Append RPC timeout equals the receiver-side lease TTL: under TiKV pressure the receiver can take ~30 s on a single append, so the sender's 30 s timeout fires at exactly the moment the receiver's lease auto-expires. The retry calls SendRemoteLock again, but by the time the lock request lands a sibling Split has already claimed the bucket; the entire 20-attempt retry budget then burns failing to re-acquire and Split rolls back. Pick 4 x TTL so a real Append timeout unambiguously means the lease has been recoverable for long enough that any concurrent acquisition has had a chance to release. The remaining cause is a hung or crashed peer, which is the actual condition this guard should fire on. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Core/SPANN/Distributed/RemotePostingOps.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h index eb1921017..2c6479571 100644 --- a/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h +++ b/AnnService/inc/Core/SPANN/Distributed/RemotePostingOps.h @@ -397,7 +397,21 @@ namespace SPTAG::SPANN { m_net->GetClient()->SendPacket(connID, std::move(packet), MakeSendFailHandler(resID)); - auto status = future.wait_for(std::chrono::seconds(30)); + // Wait long enough that a successful response is not racing + // the lease TTL. Append timeout == lease TTL deadlocks the + // fence-retry path: when TiKV is backed up and the receiver + // takes ~30 s on a single append, the sender's 30 s timeout + // fires at the same moment the receiver-side lease auto- + // expires. The retry then calls SendRemoteLock again, but + // by the time the request lands another Split has acquired + // the bucket, and the entire 20-attempt budget is spent + // failing to re-acquire. Pick 4 x TTL so that a real + // timeout unambiguously means the lease has been + // recoverable for long enough that any concurrent + // acquisition has had a chance to release; the only + // remaining cause is a hung / crashed peer. + constexpr int kAppendRpcTimeoutSec = 120; + auto status = future.wait_for(std::chrono::seconds(kAppendRpcTimeoutSec)); if (status == std::future_status::timeout) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "RemotePostingOps: Timeout waiting for append response for headID %lld from node %d\n", From 6bfe0f1c123357dcfd6f3457c40642a25fd0f900 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 16:08:06 +0000 Subject: [PATCH 38/51] fix(distributed): align WaitForRemoteBucketUnlocked wait cap to lease TTL The previous 5 s cap made the local writer barge in while a remote Split that held an advisory lease on the bucket was still mid-flight. Worst case: Split then broadcasts HeadSync Delete on srcHead and the items we just appended disappear with the head -- recall drops silently with no error. Tie the cap to RemoteLeaseTable::GetTtlMs() (default 30 s): after TTL the entry is auto-reclaimed by IsLocked() so this loop exits naturally on its own. The 'stuck for ... ms, proceeding' log path is now truly anomalous and worth surfacing in the regression-detector queries. In the 2-node insert_dominant benchmark this dropped 'stuck for' from 74 events per run to 0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index c254ef9a7..c15c5e8a8 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -799,7 +799,15 @@ namespace SPTAG::SPANN { if (!m_worker || !m_worker->IsEnabled()) return; unsigned bucket = COMMON::FineGrainedRWLock::BucketIndex(static_cast(headID)); if (!m_remoteLeaseTable->IsLocked(bucket)) return; - constexpr int kMaxRemoteBucketWaitMs = 5000; + // Bound the wait by the lease TTL. A shorter cap (we used + // 5 s previously) makes the local writer barge in while the + // remote Split is still mid-flight: if Split then broadcasts + // a HeadSync Delete on srcHead, the items we just appended + // disappear with the head and recall drops silently. After + // TTL, IsLocked auto-reclaims the lease so this loop exits + // naturally; the "stuck" log path is now truly anomalous. + const int kMaxRemoteBucketWaitMs = + m_remoteLeaseTable->GetTtlMs(); auto deadline = std::chrono::steady_clock::now() + std::chrono::milliseconds(kMaxRemoteBucketWaitMs); while (m_remoteLeaseTable->IsLocked(bucket)) { From adaf01c1d8e284df281fbecf0f19c736f69f9695 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 24 May 2026 16:08:23 +0000 Subject: [PATCH 39/51] fix(distributed): receiver-side fenced Append bypasses self-bucket wait When node A holds lease T on bucket(headX) at node B and sends a FencedRemoteAppend(T) for headX, B's RPC handler validates the fence (passes), then enters AppendCallback -> Append(headX, ...). Since headX is locally-owned on B, Append falls into WaitForRemoteBucketUnlocked(headX) -- but the lease blocking that bucket is A's, our own caller's. B waits up to TTL (~30 s) for A's lease to expire while A is blocked in SendFencedRemoteAppend waiting for B's response. Throughout that 30 s self-block every sibling Split that hashes into the same bucket sees 'lease busy', burns its 20-attempt retry budget, and rolls back. This was the dominant cause of 'lease busy' cascades on adjacent splits in the 2-node insert_dominant benchmark (~40-80 events per run; recall dropped to 0.984 with periodic Split rollbacks). Add a p_skipRemoteBucketWait bool to Append and BatchAppend; the receiver-side single-item callback passes fencingToken != 0, and the BatchAppend callback passes anyFenced computed across surviving items. Safety: fence validation upstream already proved the sender owns the lease covering all in-flight modifications to this bucket, and per-head serialization via m_rwLocks[headID] inside Append's body is unchanged. Local writers (Append called from AddIndex / Split / Reassign / Merge) keep the default false: they still honour any remote initiator's advisory lease. Result after stacking with the SendRemoteLock, fenced-Append, and WaitForRemoteBucketUnlocked TTL alignments: 0 stuck, 0 lock timeouts, 0 rollbacks, 0 cannot-re-acquire, lease-busy events drop to ~2 per run (down from 40-80). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index c15c5e8a8..a1a20672c 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -620,7 +620,8 @@ namespace SPTAG::SPANN { m_versionMap->SetVersionBatch(batchVids, batchVers); } } - return Append(ws, headID, appendNum, appendPosting, 0); + return Append(ws, headID, appendNum, appendPosting, 0, + /*p_skipRemoteBucketWait=*/fencingToken != 0); }); // Batch append callback: receiver-side fast path. @@ -704,17 +705,20 @@ namespace SPTAG::SPANN { std::unordered_map headAppends; headAppends.reserve(items.size()); size_t aliveCount = 0; + bool anyFenced = false; for (size_t i = 0; i < items.size(); ++i) { if (!alive[i]) continue; auto* req = items[i]; auto& dst = headAppends[req->m_headID]; if (dst.empty()) dst = std::move(req->m_appendPosting); else dst.append(req->m_appendPosting); + if (req->m_fencingToken != 0) anyFenced = true; ++aliveCount; } if (headAppends.empty()) return; - ErrorCode ret = BatchAppend(ws, headAppends, "PeerBatch"); + ErrorCode ret = BatchAppend(ws, headAppends, "PeerBatch", + /*p_skipRemoteBucketWait=*/anyFenced); if (ret == ErrorCode::Success) { outSuccess += static_cast(aliveCount); } else { @@ -2640,7 +2644,8 @@ namespace SPTAG::SPANN { } - ErrorCode Append(ExtraWorkSpace* p_exWorkSpace, SizeType headID, int appendNum, std::string& appendPosting, int reassignThreshold = 0) + ErrorCode Append(ExtraWorkSpace* p_exWorkSpace, SizeType headID, int appendNum, std::string& appendPosting, int reassignThreshold = 0, + bool p_skipRemoteBucketWait = false) { auto appendBegin = std::chrono::high_resolution_clock::now(); if (appendPosting.empty()) { @@ -2668,11 +2673,19 @@ namespace SPTAG::SPANN { m_stat.m_appendTaskNum++; } return ErrorCode::Success; - } else { + } else if (!p_skipRemoteBucketWait) { // Local-owned head: wait out any in-flight remote // initiator that holds an advisory fenced-lease on our // bucket (e.g. another node mid-Split) before we acquire // the per-head lock and write. + // + // Skip this wait when the caller is the receiver-side + // handler for a fenced RemoteAppend: fence validation + // upstream has already proven the sender holds the + // very lease this wait would block on, so we would be + // waiting for our own caller's lease to expire (TTL, + // ~30 s). That self-block was the dominant cause of + // "lease busy" cascades on adjacent splits. WaitForRemoteBucketUnlocked(headID); } } @@ -2786,7 +2799,8 @@ namespace SPTAG::SPANN { return ErrorCode::Success; } - ErrorCode BatchAppend(ExtraWorkSpace* p_exWorkSpace, std::unordered_map& headAppends, const char* caller) + ErrorCode BatchAppend(ExtraWorkSpace* p_exWorkSpace, std::unordered_map& headAppends, const char* caller, + bool p_skipRemoteBucketWait = false) { if (headAppends.empty()) return ErrorCode::Success; @@ -2824,7 +2838,11 @@ namespace SPTAG::SPANN { } else { m_routedLocalHeads.fetch_add(1, std::memory_order_relaxed); m_routedLocalItems.fetch_add(totalRec, std::memory_order_relaxed); - WaitForRemoteBucketUnlocked(headID); + // Skip the self-wait for receiver-side fenced + // BatchAppend (see Append() for the rationale). + if (!p_skipRemoteBucketWait) { + WaitForRemoteBucketUnlocked(headID); + } } } From 17e8646e014741d17809490a36a6db4a82145625 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Mon, 25 May 2026 12:01:44 +0000 Subject: [PATCH 40/51] Remove unused variable --- AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h | 1 - 1 file changed, 1 deletion(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index a1a20672c..a8a272050 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -265,7 +265,6 @@ namespace SPTAG::SPANN { std::shared_ptr GetDB() const { return db; } private: - std::atomic m_workspaceCount = 0; std::shared_ptr db; WorkerNode* m_worker = nullptr; // externally owned, set via SetWorker() From 82dc35a801a389c4ff72fe1eec62fec5046d586b Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 27 May 2026 03:50:43 +0000 Subject: [PATCH 41/51] fix(socket): typo in SimpleSerialization static_assert messages Replaces "fundanmental" with "fundamental" in the four static_assert messages of SimpleWriteBuffer / SimpleReadBuffer / EstimateBufferSize / SafeSimpleReadBuffer. Copilot inline review on PR #448 flagged the misspelling. Pure log/diag message change; no code semantics affected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/inc/Socket/SimpleSerialization.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AnnService/inc/Socket/SimpleSerialization.h b/AnnService/inc/Socket/SimpleSerialization.h index e0b8141dd..6c0ddddf0 100644 --- a/AnnService/inc/Socket/SimpleSerialization.h +++ b/AnnService/inc/Socket/SimpleSerialization.h @@ -23,7 +23,7 @@ namespace SimpleSerialization SimpleWriteBuffer(const T& p_val, std::uint8_t* p_buffer) { static_assert(std::is_fundamental::value || std::is_enum::value, - "Only applied for fundanmental type."); + "Only applied for fundamental type."); *(reinterpret_cast(p_buffer)) = p_val; return p_buffer + sizeof(T); @@ -35,7 +35,7 @@ namespace SimpleSerialization SimpleReadBuffer(const std::uint8_t* p_buffer, T& p_val) { static_assert(std::is_fundamental::value || std::is_enum::value, - "Only applied for fundanmental type."); + "Only applied for fundamental type."); p_val = *(reinterpret_cast(p_buffer)); return p_buffer + sizeof(T); @@ -47,7 +47,7 @@ namespace SimpleSerialization EstimateBufferSize(const T& p_val) { static_assert(std::is_fundamental::value || std::is_enum::value, - "Only applied for fundanmental type."); + "Only applied for fundamental type."); return sizeof(T); } @@ -90,7 +90,7 @@ namespace SimpleSerialization SafeSimpleReadBuffer(const std::uint8_t* p_buffer, const std::uint8_t* p_bufEnd, T& p_val) { static_assert(std::is_fundamental::value || std::is_enum::value, - "Only applied for fundanmental type."); + "Only applied for fundamental type."); if (p_buffer == nullptr) return nullptr; if (p_bufEnd != nullptr && static_cast(p_bufEnd - p_buffer) < sizeof(T)) return nullptr; From 8fd4c3088be9a13baf446fc2f33cad54b88b8de2 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 27 May 2026 03:50:53 +0000 Subject: [PATCH 42/51] build(test): gate absl_* link deps behind if(TIKV) The previous unconditional target_link_libraries on SPTAGTest pulled in absl_synchronization / absl_cord / absl_cordz_info / absl_cord_internal / absl_cordz_functions / absl_cordz_handle. These libs are only needed because gRPC's static archive references them; when TIKV=OFF (the default), neither gRPC nor any absl symbol is in the dependency closure, so demanding the libs at link time breaks builds on hosts that don't have absl installed. Top-level CMakeLists.txt declares 'option(TIKV "TIKV" OFF)' (L131) and gates TiKV_LIBRARIES on the same flag (L172-201), so this change mirrors that convention: the absl link is now nested inside 'if (TIKV)' so non-TiKV builds match upstream master's link line again. Copilot inline review on PR #448 surfaced this regression. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Test/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index 9db640da2..b1b708d6b 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -24,7 +24,12 @@ if (NOT LIBRARYONLY) file(GLOB TEST_HDR_FILES ${PROJECT_SOURCE_DIR}/Test/inc/Test.h) file(GLOB TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/Test/src/*.cpp) add_executable(SPTAGTest ${TEST_SRC_FILES} ${TEST_HDR_FILES}) - target_link_libraries(SPTAGTest SPTAGLibStatic ssdservingLib ${Boost_LIBRARIES} ${TiKV_LIBRARIES} absl_synchronization absl_cord absl_cordz_info absl_cord_internal absl_cordz_functions absl_cordz_handle) + target_link_libraries(SPTAGTest SPTAGLibStatic ssdservingLib ${Boost_LIBRARIES} ${TiKV_LIBRARIES}) + if (TIKV) + # gRPC's static libs require these absl symbols; only link when the + # TiKV backend (and thus gRPC) is in the dependency closure. + target_link_libraries(SPTAGTest absl_synchronization absl_cord absl_cordz_info absl_cord_internal absl_cordz_functions absl_cordz_handle) + endif() install(TARGETS SPTAGTest RUNTIME DESTINATION bin From 047ed5b592319b75f1cfd4a193a77d2e4094b8d3 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 27 May 2026 03:51:04 +0000 Subject: [PATCH 43/51] fix(socket): separate error_code per endpoint() call in Connection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Connection::Start() and Connection::Stop() each called local_endpoint() and remote_endpoint() in sequence, sharing a single boost::system:: error_code. boost::asio's overload writes the result into the supplied error_code on every call: a successful local_endpoint() resets the code that a subsequent remote_endpoint() failure should signal, and vice versa. For Start(), the bug skewed the 'socket not connected' branch — the log message read whichever ec was set last instead of pinpointing which endpoint actually failed, and a falsely-successful epEc could let us proceed to call .address() on an invalid remote endpoint. Stop()'s diag log had the same accuracy issue (no logic divergence because Stop has no early-return on log-only failure). Fix uses one error_code per call and only logs the success branch when both calls succeeded. Failure branch now identifies which side errored. Copilot inline review on PR #448 flagged both call sites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/src/Socket/Connection.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/AnnService/src/Socket/Connection.cpp b/AnnService/src/Socket/Connection.cpp index 444c7afb0..d99ba8882 100644 --- a/AnnService/src/Socket/Connection.cpp +++ b/AnnService/src/Socket/Connection.cpp @@ -26,17 +26,19 @@ Connection::Connection(ConnectionID p_connectionID, boost::asio::ip::tcp::socket void Connection::Start() { - boost::system::error_code epEc; - auto localEp = m_socket.local_endpoint(epEc); - auto remoteEp = m_socket.remote_endpoint(epEc); - if (!epEc) { + boost::system::error_code localEc; + boost::system::error_code remoteEc; + auto localEp = m_socket.local_endpoint(localEc); + auto remoteEp = m_socket.remote_endpoint(remoteEc); + if (!localEc && !remoteEc) { SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "Connection Start, local: %u, remote: %s:%u\n", static_cast(localEp.port()), remoteEp.address().to_string().c_str(), static_cast(remoteEp.port())); } else { - SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Connection Start, socket not connected: %s\n", - epEc.message().c_str()); + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "Connection Start, socket not connected: local=%s remote=%s\n", + localEc ? localEc.message().c_str() : "ok", + remoteEc ? remoteEc.message().c_str() : "ok"); return; } @@ -51,10 +53,11 @@ void Connection::Start() void Connection::Stop() { - boost::system::error_code epEc; - auto localEp = m_socket.local_endpoint(epEc); - auto remoteEp = m_socket.remote_endpoint(epEc); - if (!epEc) { + boost::system::error_code localEc; + boost::system::error_code remoteEc; + auto localEp = m_socket.local_endpoint(localEc); + auto remoteEp = m_socket.remote_endpoint(remoteEc); + if (!localEc && !remoteEc) { SPTAGLIB_LOG(Helper::LogLevel::LL_Debug, "Connection Stop, local: %u, remote: %s:%u\n", static_cast(localEp.port()), remoteEp.address().to_string().c_str(), From 1786092da885f87844e61f45f594d3d1befc9e6c Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 27 May 2026 03:51:24 +0000 Subject: [PATCH 44/51] fix(distributed): explicit field-wise Encode/Decode for SplitWAL::Record MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous Encode() / Decode() used memcpy(this, ..., sizeof(Record)) to serialize the whole struct. This had three problems for a record that gets written to TiKV and read back later: 1. Padding leak. The struct interleaves std::uint64_t / SizeType / std::int64_t / std::uint8_t fields; the compiler inserts alignment padding bytes between fields and tail padding after .stage. memcpy sends those bytes — which are uninitialized stack content the first time a Record is encoded — into the WAL key/value. 2. Brittleness to source-order changes. Reordering Record fields, or adding a new field anywhere except the tail, silently changes the on-the-wire byte order. Old WAL entries decode as garbage with no error signal, breaking the split-cleanup GC sweep. 3. Enum representation. Stage is declared with an explicit std::uint8_t underlying type today, but a future refactor that drops the explicit width would silently change the encoded size. Replaces memcpy with field-by-field std::memcpy at known offsets using the project's existing pattern (matches Socket SimpleWriteBuffer behavior). The wire format is now deterministic and survives both unrelated source edits and field reordering, so the Begin record that ExtraDynamicSearcher.h:940 / :1823 write is still readable after a recompile. Wire layout (in order, no padding): uint64 jobID SizeType srcHeadID, localChildHeadID, remoteChildHeadID int remoteOwnerNodeIndex int64 startTimestampSec uint8 stage kEncodedSize is exposed as a constexpr so tests / consumers can assert the size. Note: SizeType width still tracks the build-config LARGEVID flag — this is by design (matches the rest of the codebase, including the on-disk posting lists) and the WAL contract is that writer and reader must be built with the same LARGEVID setting. Copilot inline review on PR #448 flagged the memcpy approach. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/Distributed/SplitWAL.h | 51 +++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h b/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h index 3cd642a13..d083b1790 100644 --- a/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h +++ b/AnnService/inc/Core/SPANN/Distributed/SplitWAL.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -54,14 +55,56 @@ class SplitWAL { std::int64_t startTimestampSec; Stage stage; + // Wire layout: each field appended sequentially with no padding, + // stage written as a fixed std::uint8_t. Field-by-field memcpy + // avoids leaking uninitialized struct padding into the WAL and + // keeps the encoding stable if fields are reordered in source. + // Field widths still follow the build-config-bound SizeType + // (int32 by default, int64 with -DLARGEVID); a deployment must + // not toggle LARGEVID between WAL writer and reader. + static constexpr std::size_t kEncodedSize = + sizeof(std::uint64_t) /* jobID */ + + sizeof(SizeType) /* srcHeadID */ + + sizeof(SizeType) /* localChildHeadID */ + + sizeof(SizeType) /* remoteChildHeadID */ + + sizeof(int) /* remoteOwnerNodeIndex */ + + sizeof(std::int64_t) /* startTimestampSec */ + + sizeof(std::uint8_t); /* stage */ + std::string Encode() const { - std::string s(sizeof(Record), '\0'); - memcpy(&s[0], this, sizeof(Record)); + std::string s(kEncodedSize, '\0'); + std::size_t off = 0; + auto put = [&](const void* src, std::size_t n) { + std::memcpy(&s[off], src, n); + off += n; + }; + put(&jobID, sizeof(jobID)); + put(&srcHeadID, sizeof(srcHeadID)); + put(&localChildHeadID, sizeof(localChildHeadID)); + put(&remoteChildHeadID, sizeof(remoteChildHeadID)); + put(&remoteOwnerNodeIndex, sizeof(remoteOwnerNodeIndex)); + put(&startTimestampSec, sizeof(startTimestampSec)); + std::uint8_t st = static_cast(stage); + put(&st, sizeof(st)); return s; } + bool Decode(const std::string& s) { - if (s.size() < sizeof(Record)) return false; - memcpy(this, s.data(), sizeof(Record)); + if (s.size() < kEncodedSize) return false; + std::size_t off = 0; + auto get = [&](void* dst, std::size_t n) { + std::memcpy(dst, s.data() + off, n); + off += n; + }; + get(&jobID, sizeof(jobID)); + get(&srcHeadID, sizeof(srcHeadID)); + get(&localChildHeadID, sizeof(localChildHeadID)); + get(&remoteChildHeadID, sizeof(remoteChildHeadID)); + get(&remoteOwnerNodeIndex, sizeof(remoteOwnerNodeIndex)); + get(&startTimestampSec, sizeof(startTimestampSec)); + std::uint8_t st = 0; + get(&st, sizeof(st)); + stage = static_cast(st); return true; } }; From 149bdd4d26543ade538f6a1b17cfb7280fc74a8d Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 27 May 2026 03:51:47 +0000 Subject: [PATCH 45/51] fix(distributed): graceful WorkerNode shutdown drains auto-flush threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QueueRemoteAppend spawns detached std::thread instances that capture 'this' (WorkerNode) when the per-node queue crosses kAutoFlushThreshold. Each thread loops over chunks, accesses m_appendQueueMutex / m_appendQueue / m_asyncWatchdog, and decrements m_inflightAppendFlushes on exit. Without a destructor, if WorkerNode is destroyed while any of those threads are still running, the members get torn down underneath the threads and we get a use-after-free. In the current SPTAGTest driver this is masked because WorkerNode lives for the entire process and the OS reaps the threads on exit. But the hazard becomes real as soon as we want to: * gracefully shut down one worker node in a multi-node deployment (e.g. for an in-place upgrade or rolling restart); * reconstruct the WorkerNode after a config reload; * tear down WorkerNode in unit tests. The remote-node-failure case is NOT a UAF: SendBatchRemoteAppend to a dead peer returns Fail, the local thread hands the batch to the local m_asyncWatchdog (which itself captures self=this on a local object), the watchdog retries up to MaxAttempts and gives up. As long as the LOCAL WorkerNode is alive, all dereferences are safe. The hazard is purely tied to local destruction. Fix: gate-then-drain shutdown in ~WorkerNode(). Phase 1: m_acceptingNewRequests is set to false. QueueRemoteAppend consults this flag at the top of its body and returns early with a warning log if shutdown has started. This ensures no NEW auto-flush thread can be spawned. Phase 2: wait for m_inflightAppendFlushes to reach zero. The wait is unbounded by design — with the gate set, each in-flight thread is bounded by its current SendBatchRemoteAppend gRPC call (~kTimeoutSec, default 180s) plus one more iteration that sees an empty queue and breaks. Concurrent threads drain in parallel, so worst-case wall time is one gRPC timeout regardless of how many threads are in flight. A hard timeout was considered and rejected: breaking out early would let detached threads outlive m_appendQueueMutex / m_appendQueue / m_asyncWatchdog and immediately UAF — strictly worse than a slow shutdown. If shutdown ever stays stuck past one gRPC timeout in production the diagnostic to chase is 'gRPC client is wedged', not 'tune a destructor timeout'. A periodic LL_Warning log every 30s reports how many threads are still inflight so operators see progress. Phase 3: members destruct in reverse declaration order; m_asyncWatchdog's own destructor (AsyncJobWatchdog.h:48) joins its loop thread, then the mutex / queue / etc. tear down with no live consumer threads. Also logs a LL_Warning if m_remoteQueueSize > 0 at destruction so callers are reminded to invoke FlushRemoteAppends first if they care about durability of the residue. Copilot inline review on PR #448 flagged the detach() lifecycle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/Distributed/WorkerNode.h | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h index 116b6c25f..77a251262 100644 --- a/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h +++ b/AnnService/inc/Core/SPANN/Distributed/WorkerNode.h @@ -103,6 +103,59 @@ namespace SPTAG::SPANN { public: bool Start() { return StartNetwork(); } + // Gate + drain shutdown: + // 1. Reject new QueueRemoteAppend producers via m_acceptingNewRequests. + // 2. Wait for any in-flight auto-flush detached threads to exit. + // With the gate set, each thread is bounded by its current + // SendBatchRemoteAppend call (~kTimeoutSec, default 180s) plus + // one more loop iteration that will see an empty queue (no + // new producers) and break. So worst-case wall time is one + // gRPC timeout, regardless of concurrency. + // 3. Member destruction runs after this body: m_asyncWatchdog's own + // destructor (AsyncJobWatchdog.h:48) joins its loop thread, then + // mutex/queue members tear down cleanly. + // Callers are expected to have invoked FlushRemoteAppends() before + // destruction; any residue in m_appendQueue is dropped with a warning. + // + // The wait is unbounded by design: a hard timeout here would let + // threads outlive the members they captured (m_appendQueueMutex / + // m_appendQueue / m_asyncWatchdog) and immediately UAF — strictly + // worse than a slow shutdown. If shutdown ever stays stuck past a + // gRPC timeout in production, the diagnostic to chase is "gRPC + // client is wedged", not "tune the destructor timeout". + ~WorkerNode() { + m_acceptingNewRequests.store(false, std::memory_order_release); + + // Log every 2x RPC timeout: that gives one full RPC cycle as + // the healthy-drain upper bound (gate -> each in-flight thread + // bounded by exactly one SendBatchRemoteAppend cycle), plus a + // second cycle of buffer so a slightly slow-but-healthy drain + // doesn't false-alarm. Past 2x is firmly into "gRPC client is + // wedged" territory and worth a LL_Warning. + const auto logInterval = std::chrono::seconds( + 2 * std::max(1, m_remoteOps.GetRpcTimeoutSec())); + + auto lastLogged = std::chrono::steady_clock::now(); + while (m_inflightAppendFlushes.load(std::memory_order_acquire) > 0) { + auto now = std::chrono::steady_clock::now(); + if (now - lastLogged >= logInterval) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "~WorkerNode: still waiting on %d in-flight auto-flush thread(s) " + "(exceeded 2x RPC timeout, gRPC may be wedged)\n", + m_inflightAppendFlushes.load(std::memory_order_relaxed)); + lastLogged = now; + } + std::this_thread::sleep_for(kShutdownPollInterval); + } + + const size_t residue = m_remoteQueueSize.load(std::memory_order_relaxed); + if (residue > 0) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "~WorkerNode: dropping %zu queued RemoteAppend item(s) at destruction; " + "caller should have invoked FlushRemoteAppends() first\n", residue); + } + } + // ---- Callbacks ---- // // ExtraDynamicSearcher passes its m_layer when binding callbacks so @@ -277,6 +330,12 @@ namespace SPTAG::SPANN { // ---- Append queue ---- void QueueRemoteAppend(int nodeIndex, RemoteAppendRequest req) { + if (!m_acceptingNewRequests.load(std::memory_order_acquire)) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "WorkerNode: rejecting QueueRemoteAppend to node %d during shutdown\n", + nodeIndex); + return; + } std::vector toFlush; bool didReserveSlot = false; { @@ -672,6 +731,20 @@ namespace SPTAG::SPANN { static constexpr size_t kAutoFlushThreshold = 50000; std::atomic m_maxInflightPerNode{4}; + // Gate: producers (QueueRemoteAppend) consult this; the destructor + // sets it to false to drain in-flight auto-flush threads to zero + // without new threads being spawned. + std::atomic m_acceptingNewRequests{true}; + + // Shutdown wait tuning (used only by ~WorkerNode). + // - kShutdownPollInterval: how often the destructor wakes to + // re-check m_inflightAppendFlushes. 20ms keeps p50 shutdown + // latency tight when threads exit between polls. + // - The progress-log cadence is derived at destruction time + // from m_remoteOps.GetRpcTimeoutSec() — see ~WorkerNode(). + static constexpr auto kShutdownPollInterval = + std::chrono::milliseconds(20); + // Resends failed async fire-and-forget batches with exponential // backoff (see AsyncJobWatchdog.h). Constructed last so it tears // down before the queues; declared here so destruction order From 5d4dbd3e8e32b62042c535ce4021bb0336c2ee0f Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Wed, 27 May 2026 11:00:21 +0000 Subject: [PATCH 46/51] fix(bench): move SPTAGTest CWD to per-scale scratch dir on NVMe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestDataGenerator writes perftest_*.bin files (notably perftest_vector.bin which is Dim*BaseVectorCount bytes — 118GB at 1B with UInt8/dim=128) relative to CWD. The previous CWD was $SPTAG_DIR (the SPTAG repo dir, on /), so at 1B scale the 118GB write filled the root partition, truncated the file, then groundtruth generation's follow-up read raised 'Failed to read VectorSet' and aborted the build. Change every SPTAGTest invocation (driver build, driver run, worker) to cd into $DATA_DIR/scratch_${SCALE}_${NODE_COUNT}node/ instead. This puts perftest_*.bin (and TruthPath='truth', BENCHMARK_OUTPUT) on the same big NVMe volume that already holds the index data. distribute_perftest_files now takes the SCALE and rsyncs from the driver's SCRATCH_DIR to each worker's SCRATCH_DIR. cmd_deploy's perftest_* deploy section is dropped (it is redundant with the post-build distribute_perftest_files step and could not pick a scratch dir without knowing the scale anyway). cmd_cleanup also removes $DATA_DIR/scratch_*/ on every remote. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- evaluation/distributed/run_distributed.sh | 62 +++++++++++++---------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/evaluation/distributed/run_distributed.sh b/evaluation/distributed/run_distributed.sh index 28404c8a3..57f43f98b 100755 --- a/evaluation/distributed/run_distributed.sh +++ b/evaluation/distributed/run_distributed.sh @@ -237,18 +237,10 @@ cmd_deploy() { fi done - # Deploy data files (perftest_* vectors, queries) - echo "" - echo "Deploying data files..." - for host in "${NODE_HOSTS[@]}"; do - if [ "$host" = "${NODE_HOSTS[0]}" ]; then continue; fi - echo " → $host:$SPTAG_DIR/ (perftest_* files)" - remote_exec "$host" "mkdir -p $SPTAG_DIR" - rsync -az --progress \ - --include='perftest_*' --exclude='*' \ - -e "ssh $(_ssh_opts)" \ - "$SPTAG_DIR/" "$SSH_USER@$host:$SPTAG_DIR/" - done + # perftest_* data files are generated by SPTAGTest at runtime in SCRATCH_DIR + # and rsynced by distribute_perftest_files() during cmd_run, so cmd_deploy + # no longer needs to push them. (Pushing here also wouldn't know which + # scale's SCRATCH_DIR to source from.) echo "" echo "Deploy complete." @@ -732,9 +724,13 @@ start_remote_worker() { local NODE_COUNT="$4" local host="${NODE_HOSTS[$NODE_IDX]}" local LOG="$LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_worker${NODE_IDX}.log" + local SCRATCH_DIR="$DATA_DIR/scratch_${SCALE}_${NODE_COUNT}node" - # Copy INI + binary to remote - remote_sync "$host" "$INI" "$SPTAG_DIR/worker_n${NODE_IDX}.ini" + # Ensure scratch dir exists on remote, then copy INI there. SPTAGTest's CWD + # is set to SCRATCH_DIR so TestDataGenerator's relative perftest_*.bin + # files land on the big NVMe disk, not on /. + remote_exec "$host" "mkdir -p $SCRATCH_DIR" + remote_sync "$host" "$INI" "$SCRATCH_DIR/worker_n${NODE_IDX}.ini" # Start worker via SSH (foreground on remote, background locally). # Use `ssh -n` to redirect stdin from /dev/null so SSH doesn't try to @@ -742,9 +738,9 @@ start_remote_worker() { # the SSH client sometimes silently re-points fd1 → /dev/null and fd2 # → a deleted /tmp file, dropping the worker log. ssh -n $(_ssh_opts) "$SSH_USER@$host" \ - "cd $SPTAG_DIR && LD_LIBRARY_PATH=$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:\${LD_LIBRARY_PATH:-} \ + "cd $SCRATCH_DIR && LD_LIBRARY_PATH=$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:\${LD_LIBRARY_PATH:-} \ WORKER_INDEX=${NODE_IDX} BENCHMARK_CONFIG=worker_n${NODE_IDX}.ini \ - ./Release/SPTAGTest --run_test=SPFreshTest/BenchmarkFromConfig 2>&1" \ + $SPTAG_DIR/Release/SPTAGTest --run_test=SPFreshTest/BenchmarkFromConfig 2>&1" \ "$LOG" 2>&1 & local ssh_pid=$! WORKER_SSH_PIDS+=($ssh_pid) @@ -846,16 +842,19 @@ distribute_head_index() { } distribute_perftest_files() { - # rsync generated perftest_* files from driver to workers. - local NODE_COUNT="$1" + # rsync generated perftest_* files from driver SCRATCH_DIR to worker SCRATCH_DIR. + local SCALE="$1" + local NODE_COUNT="$2" + local SCRATCH_DIR="$DATA_DIR/scratch_${SCALE}_${NODE_COUNT}node" echo "Distributing perftest_* data files to workers..." for (( i=1; i&1 ) \ | tee "$LOGDIR/benchmark_${SCALE}_1node_driver.log" @@ -950,7 +955,7 @@ cmd_run() { local BUILD_INI BUILD_INI=$(generate_ini "$SCALE" 1 "${BUILD_MODE_OVERRIDES[@]}" "BuildOnly=true" "${BUILD_VERSIONCACHE_OVERRIDES[@]}") || exit 1 - ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$BUILD_INI" \ + ( cd "$SCRATCH_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$BUILD_INI" \ BENCHMARK_OUTPUT="output_${SCALE}_1node_build.json" \ "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig 2>&1 ) \ | tee "$LOGDIR/benchmark_${SCALE}_1node_build.log" @@ -974,7 +979,7 @@ cmd_run() { local RUN_INI RUN_INI=$(generate_ini "$SCALE" 1 "Rebuild=false" "VersionCacheTTLMs=0" "VersionCacheMaxChunks=0") || exit 1 - ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$RUN_INI" \ + ( cd "$SCRATCH_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$RUN_INI" \ BENCHMARK_OUTPUT="output_${SCALE}_1node.json" \ "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig 2>&1 ) \ | tee "$LOGDIR/benchmark_${SCALE}_1node_driver.log" @@ -985,7 +990,7 @@ cmd_run() { INI=$(generate_ini "$SCALE" 1 "${BUILD_MODE_OVERRIDES[@]}") || exit 1 echo "Starting driver on ${NODE_HOSTS[0]}..." - ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$INI" \ + ( cd "$SCRATCH_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$INI" \ BENCHMARK_OUTPUT="output_${SCALE}_1node.json" \ "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig 2>&1 ) \ | tee "$LOGDIR/benchmark_${SCALE}_1node_driver.log" @@ -1052,7 +1057,7 @@ cmd_run() { # launched during the build phase; they come up in Phase 3 (run). local BUILD_LOG="$LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_build.log" echo "Starting driver build on ${NODE_HOSTS[0]}..." - ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$BUILD_INI" \ + ( cd "$SCRATCH_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$BUILD_INI" \ BENCHMARK_OUTPUT="output_${SCALE}_${NODE_COUNT}node_build.json" \ "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig ) \ > "$BUILD_LOG" 2>&1 & @@ -1089,7 +1094,7 @@ cmd_run() { rm -f "$DATA_DIR/proidx_${SCALE}_${NODE_COUNT}node/spann_index/checkpoint.txt" distribute_head_index "$SCALE" "$NODE_COUNT" - distribute_perftest_files "$NODE_COUNT" + distribute_perftest_files "$SCALE" "$NODE_COUNT" # Sync SPTAGTest binary + bundled runtime libs to all workers so # they pick up the latest compiled changes. (cmd_deploy is a separate @@ -1133,7 +1138,7 @@ cmd_run() { # workers need to connect to for ring registration. local DRIVER_LOG="$LOGDIR/benchmark_${SCALE}_${NODE_COUNT}node_driver.log" echo "Starting driver (dispatcher+worker0) on ${NODE_HOSTS[0]}..." - ( cd "$SPTAG_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$RUN_INI" \ + ( cd "$SCRATCH_DIR" && LD_LIBRARY_PATH="$SPTAG_DIR/Release/runtime_libs:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BENCHMARK_CONFIG="$RUN_INI" \ BENCHMARK_OUTPUT="output_${SCALE}_${NODE_COUNT}node.json" \ "$BINARY" --run_test=SPFreshTest/BenchmarkFromConfig ) \ > "$DRIVER_LOG" 2>&1 & @@ -1269,7 +1274,10 @@ cmd_cleanup() { for i in $(seq 1 $((${#NODE_HOSTS[@]} - 1))); do local host="${NODE_HOSTS[$i]}" echo " Cleaning $host..." + # Older runs wrote perftest_* and worker_*.ini directly under + # $SPTAG_DIR; current runs put them in $DATA_DIR/scratch_*/. Clean both. remote_exec "$host" "rm -rf $SPTAG_DIR/Release/SPTAGTest $SPTAG_DIR/perftest_* $SPTAG_DIR/worker_*.ini" + remote_exec "$host" "rm -rf $DATA_DIR/scratch_*" # Clean index directories remote_exec "$host" "rm -rf $DATA_DIR/proidx_*" done From dabe74a4bb4b662ec6a80a1cccf5a9ec80f2f642 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 31 May 2026 03:26:19 +0000 Subject: [PATCH 47/51] fix(versionmap): restore per-layer Initialize to seed alive heads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the qiazh refactor commented out the m_versionMap->Initialize(...) call in ExtraDynamicSearcher::BuildIndex and replaced it with a dead per-VID Deleted+SetVersion loop, layer-1 (head index) postings were silently corrupted on the first async MergePostings: * TiKVVersionMap uses default=0xfe (deleted) for layer >0. With Initialize skipped, alive heads have no per-VID byte. GetVersion returns the 0xfe default → Deleted() returns true. * WriteDownAllPostingToDB stores version=GetVersion(headVID)=0xfe in every layer-1 base posting entry. * MergePostings' filter at L2021 (Deleted(VID) || GetVersion!=version) drops every entry, so the merged-with-neighbor head writes a tiny corrupted posting. After ~10K small async merges triggered during concurrent search-during-insert, the head index is destroyed. Symptom on the 1M+1M insert_dominant 1-node bench: pre-insert recall = 0.985, post-insert recall = 0.218 Fix: * Re-add Initialize to IVersionMap interface with default impl SetR(size) so existing implementations (array-backed) compile unchanged. * Make TiKVVersionMap::Initialize an explicit override (it already persists 0x00 for each alive head when m_layer > 0). * Add LocalVersionMap::Initialize override that explicitly writes 0x00 for each globalID -- the hashmap variant has the same default=0xfe problem when a key is missing. * Restore m_versionMap->Initialize(...) at ExtraDynamicSearcher.h:3653 with an explanatory comment block. Validated on 1M+1M insert_dominant 1-node: pre-insert recall = 0.9850 post-insert recall = 0.9830 (was 0.218 before fix) layer-1 async merges during run: 218 (was 54K before fix) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/inc/Core/Common/IVersionMap.h | 24 ++++++++++++++ AnnService/inc/Core/Common/LocalVersionMap.h | 23 +++++++++++++ AnnService/inc/Core/Common/TiKVVersionMap.h | 2 +- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 32 +++++++++++-------- 4 files changed, 67 insertions(+), 14 deletions(-) diff --git a/AnnService/inc/Core/Common/IVersionMap.h b/AnnService/inc/Core/Common/IVersionMap.h index 9c9c8c7dd..e7621ec2e 100644 --- a/AnnService/inc/Core/Common/IVersionMap.h +++ b/AnnService/inc/Core/Common/IVersionMap.h @@ -30,6 +30,30 @@ namespace SPTAG virtual void DeleteAll() = 0; + /// One-time per-layer setup performed at the end of BuildIndex. + /// size total VID count for this layer (== m_opt->m_vectorSize) + /// blockSize/capacity hints for array-backed legacy maps; ignored + /// by hashmap / TiKV implementations + /// globalIDs (optional) set of GLOBAL VIDs that are alive on + /// this layer. Layers whose "default + /// version" semantics treat unknown VIDs as + /// DELETED (e.g. TiKV layer >0, hashmap + /// LocalVersionMap) MUST persist an + /// explicit alive byte for each globalID; + /// otherwise MergePostings' + /// Deleted()/version-mismatch filter + /// eats every base entry on the first + /// async merge and corrupts the head index. + /// Default impl: just bump the internal count via SetR. + virtual void Initialize(SizeType size, SizeType blockSize, SizeType capacity, + COMMON::Dataset* globalIDs = nullptr) + { + (void)blockSize; + (void)capacity; + (void)globalIDs; + SetR(size); + } + virtual SizeType Count() = 0; virtual SizeType GetDeleteCount() = 0; virtual std::uint64_t BufferSize() = 0; diff --git a/AnnService/inc/Core/Common/LocalVersionMap.h b/AnnService/inc/Core/Common/LocalVersionMap.h index 5b185183e..c01e1bdcd 100644 --- a/AnnService/inc/Core/Common/LocalVersionMap.h +++ b/AnnService/inc/Core/Common/LocalVersionMap.h @@ -27,6 +27,29 @@ namespace SPTAG m_label.clear(); } + void Initialize(SizeType size, SizeType blockSize, SizeType capacity, + COMMON::Dataset* globalIDs = nullptr) override + { + (void)size; + (void)blockSize; + (void)capacity; + if (globalIDs == nullptr || globalIDs->R() <= 0) return; + + // Hashmap LocalVersionMap treats missing keys as deleted + // (Deleted() returns true, GetVersion() returns 0xfe). + // Layer-1 build calls Initialize with the alive-head global + // IDs; we must explicitly mark them alive (0x00) so that + // MergePostings' Deleted()/version-mismatch filter does not + // strip every base head entry on the first async merge. + std::unique_lock lock(m_updateMutex); + for (SizeType i = 0; i < globalIDs->R(); i++) { + SizeType globalID = *(globalIDs->At(i)); + if (globalID >= 0) { + m_label[globalID] = 0x00; + } + } + } + SizeType Count() override { std::shared_lock lock(m_updateMutex); return (SizeType)(m_label.size()); diff --git a/AnnService/inc/Core/Common/TiKVVersionMap.h b/AnnService/inc/Core/Common/TiKVVersionMap.h index d85489686..8c9d4b5b9 100644 --- a/AnnService/inc/Core/Common/TiKVVersionMap.h +++ b/AnnService/inc/Core/Common/TiKVVersionMap.h @@ -212,7 +212,7 @@ namespace SPTAG std::shared_ptr GetDB() const { return m_db; } - void Initialize(SizeType size, SizeType blockSize, SizeType capacity, COMMON::Dataset* globalIDs = nullptr) + void Initialize(SizeType size, SizeType blockSize, SizeType capacity, COMMON::Dataset* globalIDs = nullptr) override { (void)blockSize; (void)capacity; diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index c12116f67..8b51f6b8d 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -3650,19 +3650,25 @@ namespace SPTAG::SPANN { auto fullVectors = p_reader->GetVectorSet(); if (m_opt->m_distCalcMethod == DistCalcMethod::Cosine && !p_reader->IsNormalized() && !p_headIndex->m_pQuantizer) fullVectors->Normalize(m_opt->m_iSSDNumberOfThreads); - //SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: initialize versionMap\n"); - //m_versionMap->Initialize(m_opt->m_vectorSize, p_headIndex->m_iDataBlockSize, p_headIndex->m_iDataCapacity, &p_localToGlobal); - - if (p_localToGlobal.R() > 0) { - for (SizeType i = 0; i < p_localToGlobal.R(); i++) { - SizeType globalID = *(p_localToGlobal[i]); - if (m_versionMap->Deleted(globalID)) m_versionMap->SetVersion(globalID, -1); - } - } else { - for (SizeType i = 0; i < m_opt->m_vectorSize; i++) { - if (m_versionMap->Deleted(i)) m_versionMap->SetVersion(i, -1); - } - } + // Initialize the per-layer version map. For TiKVVersionMap this: + // - layer 0 (default=0x00 alive): bumps m_count only; no per-VID + // writes. Inserts later rely on the default 0x00 == alive. + // - layer >0 (default=0xfe deleted): writes 0x00 explicitly for + // each alive head in p_localToGlobal so MergePostings' + // Deleted()/GetVersion filter (L2021) doesn't silently drop + // legitimate base heads during async merges. Without this, + // layer-1 MergePostings reads stored version=0xfe, sees + // Deleted()=true (because per-VID byte is missing → reads + // default 0xfe), filters every entry, and writes back a + // corrupted near-empty posting -- destroying recall after + // even a single async merge. + // LocalVersionMap (hashmap) treats missing keys as deleted + // (returns 0xfe) and so has the same problem; its Initialize + // override also persists 0x00 for each globalID. + m_versionMap->Initialize(m_opt->m_vectorSize, + p_headIndex->m_iDataBlockSize, + p_headIndex->m_iDataCapacity, + &p_localToGlobal); SPTAGLIB_LOG(Helper::LogLevel::LL_Info, "SPFresh: Writing values to DB\n"); From e7ef65d28d00f75878cef87de77e84ad40a90bc9 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Sun, 31 May 2026 14:19:18 +0000 Subject: [PATCH 48/51] perf(versionmap): batch per-VID hot loops via BatchGetVersions/MultiPut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TiKV-backed VersionMap (commit 05d046ec) intentionally drops the in-memory chunk cache for correctness under multi-node concurrent writes. As a result every per-VID Deleted/GetVersion/SetVersion is a synchronous TiKV roundtrip (~1-2ms). The build-time per-VID hot loops in Initialize and the maintenance loops in MergePostings/Split/ RefineIndex/CollectReAssign were never optimized — each merge/split issued N serial RPCs where N is the posting size (~250 entries). This change batches those hot paths using the existing IVersionMap::BatchGetVersions (one MultiGet RPC) and KeyValueIO::MultiPut (one region-grouped batched RPC), without introducing a cache and without changing the per-VID key schema. TiKVVersionMap.h ---------------- - Initialize(layer 1): replace 200K serial PutByte with MultiPut in 4096-key chunks; fall back to serial PutByte if the backend lacks MultiPut. Layer-1 build dropped from 186s to 89s in the 1M+1M insert_dominant 1-node bench. - SetVersionBatch: route through MultiPut directly instead of a serial SetVersion loop. m_deleted accounting is approximate in the batched path (no read-old-then-write), which is acceptable because GetDeleteCount() returns 0 for the TiKV-backed map by design. ExtraDynamicSearcher.h ---------------------- Replace 7 inline 'Deleted(VID) || GetVersion(VID) != version' patterns with one BatchGetVersions per posting: - MergePostings: current-posting (with headID appended), next-posting, and post-merge reassign loops. - Split: filter-live-entries loop. The retry-on-invalid-VID semantics are preserved via a pre-scan before the batched read. - Split-merge: per-entry version reads. - RefineIndex: per-entry + globalID version reads. - CollectReAssign: postingLists loop and nearbyPostings loop. Plus the two RemoteAppend mirror loops in the receiver callbacks (AppendCallback and BatchAppendCallback) now batch the per-record GetVersion reads before issuing the SetVersionBatch write. Measured impact (1M+1M insert_dominant, 1-node, TiKV): - Total build time: 693s -> 585s (-16%) - Layer 1 BuildSSDIndex: 186s -> 89s (-52%) - Pre-insert recall: 0.98 (unchanged) - Pre-insert search QPS (warm round 2): 526 (recovered) - Insert throughput: ~205 ops/s (unchanged; the remaining bottleneck is per-Append db->Merge TiKV CAS, which is per-key and cannot be batched across keys) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/inc/Core/Common/TiKVVersionMap.h | 86 ++++++- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 224 +++++++++++++----- 2 files changed, 249 insertions(+), 61 deletions(-) diff --git a/AnnService/inc/Core/Common/TiKVVersionMap.h b/AnnService/inc/Core/Common/TiKVVersionMap.h index 8c9d4b5b9..61b131575 100644 --- a/AnnService/inc/Core/Common/TiKVVersionMap.h +++ b/AnnService/inc/Core/Common/TiKVVersionMap.h @@ -6,6 +6,7 @@ #include "IVersionMap.h" #include "inc/Helper/KeyValueIO.h" +#include #include #include #include @@ -233,10 +234,44 @@ namespace SPTAG m_deleted = size; SaveMetadata(); + // Batch the alive-marker writes via MultiPut so they + // can be grouped per TiKV region and issued in parallel. + // Serial PutByte was the build-time hotspot (~1-2ms + // per write × ~200K alive heads at 1M-vector scale). + std::vector aliveSorted; + aliveSorted.reserve(aliveIDs.size()); + for (SizeType id : aliveIDs) aliveSorted.push_back(id); + std::sort(aliveSorted.begin(), aliveSorted.end()); + SizeType written = 0; - for (SizeType globalID : aliveIDs) { - if (PutByte(VersionKey(globalID), 0x00) == ErrorCode::Success) { - written++; + constexpr size_t kBatchSize = 4096; + std::vector keys; + std::vector values; + keys.reserve(kBatchSize); + values.reserve(kBatchSize); + const std::string aliveByte(1, static_cast(0x00)); + for (size_t i = 0; i < aliveSorted.size(); i++) { + keys.push_back(VersionKey(aliveSorted[i])); + values.push_back(aliveByte); + if (keys.size() >= kBatchSize || i + 1 == aliveSorted.size()) { + auto ret = m_db->MultiPut(keys, values, MaxTimeout, nullptr); + if (ret == ErrorCode::Success) { + written += static_cast(keys.size()); + } else if (ret == ErrorCode::Undefined) { + // Backend lacks MultiPut: fall back to serial PutByte. + for (const auto& k : keys) { + if (PutByte(k, 0x00) == ErrorCode::Success) written++; + } + } else { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "TiKVVersionMap::Initialize: MultiPut batch failed layer=%d ret=%d size=%zu; falling back to serial PutByte for this batch.\n", + m_layer, static_cast(ret), keys.size()); + for (const auto& k : keys) { + if (PutByte(k, 0x00) == ErrorCode::Success) written++; + } + } + keys.clear(); + values.clear(); } } m_deleted = size - written; @@ -336,15 +371,52 @@ namespace SPTAG } // Per-VID batch write: mirrors SetVersion() for each (vid, ver) pair. - // The new per-VID-key TiKVVersionMap has no chunked batching path, so - // this is a thin convenience loop. Performance-sensitive callers - // can switch to m_db->MultiPut() directly if profiling requires it. + // Uses TiKVIO MultiPut so the writes are grouped per TiKV region + // and issued in parallel. m_deleted accounting is approximate + // here (we do not read the old byte to compute the exact delta); + // GetDeleteCount() returns 0 for the TiKV-backed version map so + // this approximation is acceptable. Callers that need precise + // accounting can call SetVersion() per-VID instead. void SetVersionBatch(const std::vector& vids, const std::vector& versions) override { size_t n = std::min(vids.size(), versions.size()); if (n == 0) return; + + SizeType count = m_count.load(); + std::vector keys; + std::vector values; + keys.reserve(n); + values.reserve(n); for (size_t i = 0; i < n; ++i) { - SetVersion(vids[i], versions[i]); + if (vids[i] < 0 || vids[i] >= count) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Error, + "TiKVVersionMap::SetVersionBatch: invalid key %d (max %d)\n", + vids[i], count); + continue; + } + keys.push_back(VersionKey(vids[i])); + values.push_back(std::string(1, static_cast(versions[i]))); + } + if (keys.empty()) return; + + auto ret = m_db->MultiPut(keys, values, MaxTimeout, nullptr); + if (ret == ErrorCode::Undefined) { + // Backend lacks MultiPut: fall back to serial SetVersion + // which preserves m_deleted accounting. + for (size_t i = 0; i < n; ++i) { + if (vids[i] >= 0 && vids[i] < count) { + SetVersion(vids[i], versions[i]); + } + } + } else if (ret != ErrorCode::Success) { + SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, + "TiKVVersionMap::SetVersionBatch: MultiPut failed layer=%d ret=%d keys=%zu; falling back to per-VID SetVersion.\n", + m_layer, static_cast(ret), keys.size()); + for (size_t i = 0; i < n; ++i) { + if (vids[i] >= 0 && vids[i] < count) { + SetVersion(vids[i], versions[i]); + } + } } } diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 8b51f6b8d..9d19265c4 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -595,21 +595,37 @@ namespace SPTAG::SPANN { const uint8_t* basePtr = reinterpret_cast(appendPosting.data()); size_t totalRec = appendPosting.size() / m_vectorInfoSize; - std::vector batchVids; - std::vector batchVers; - batchVids.reserve(totalRec); - batchVers.reserve(totalRec); + // Pre-build the candidate set and batch-read current + // versions to avoid one TiKV Get per record. + std::vector candIdx; + std::vector candVids; + std::vector candRecVers; + candIdx.reserve(totalRec); + candVids.reserve(totalRec); + candRecVers.reserve(totalRec); for (size_t i = 0; i < totalRec; ++i) { const uint8_t* p = basePtr + i * m_vectorInfoSize; SizeType vid = *reinterpret_cast(p); uint8_t recVer = *(p + sizeof(SizeType)); if (vid < 0) continue; if (recVer == 0xfe) continue; - uint8_t curVer = m_versionMap->GetVersion(vid); + candIdx.push_back(i); + candVids.push_back(vid); + candRecVers.push_back(recVer); + } + std::vector curVers; + m_versionMap->BatchGetVersions(candVids, curVers); + + std::vector batchVids; + std::vector batchVers; + batchVids.reserve(candVids.size()); + batchVers.reserve(candVids.size()); + for (size_t k = 0; k < candVids.size(); ++k) { + uint8_t curVer = curVers[k]; if (curVer == 0xfe) continue; - if (curVer == recVer) continue; - batchVids.push_back(vid); - batchVers.push_back(recVer); + if (curVer == candRecVers[k]) continue; + batchVids.push_back(candVids[k]); + batchVers.push_back(candRecVers[k]); } if (!batchVids.empty()) { m_versionMap->SetVersionBatch(batchVids, batchVers); @@ -670,21 +686,35 @@ namespace SPTAG::SPANN { const uint8_t* basePtr = reinterpret_cast(req->m_appendPosting.data()); size_t totalRec = req->m_appendPosting.size() / m_vectorInfoSize; - std::vector batchVids; - std::vector batchVers; - batchVids.reserve(totalRec); - batchVers.reserve(totalRec); + std::vector candIdx; + std::vector candVids; + std::vector candRecVers; + candIdx.reserve(totalRec); + candVids.reserve(totalRec); + candRecVers.reserve(totalRec); for (size_t k = 0; k < totalRec; ++k) { const uint8_t* p = basePtr + k * m_vectorInfoSize; SizeType vid = *reinterpret_cast(p); uint8_t recVer = *(p + sizeof(SizeType)); if (vid < 0) continue; if (recVer == 0xfe) continue; - uint8_t curVer = m_versionMap->GetVersion(vid); + candIdx.push_back(k); + candVids.push_back(vid); + candRecVers.push_back(recVer); + } + std::vector curVers; + m_versionMap->BatchGetVersions(candVids, curVers); + + std::vector batchVids; + std::vector batchVers; + batchVids.reserve(candVids.size()); + batchVers.reserve(candVids.size()); + for (size_t k = 0; k < candVids.size(); ++k) { + uint8_t curVer = curVers[k]; if (curVer == 0xfe) continue; - if (curVer == recVer) continue; - batchVids.push_back(vid); - batchVers.push_back(recVer); + if (curVer == candRecVers[k]) continue; + batchVids.push_back(candVids[k]); + batchVers.push_back(candRecVers[k]); } if (!batchVids.empty()) { m_versionMap->SetVersionBatch(batchVids, batchVers); @@ -1135,15 +1165,25 @@ namespace SPTAG::SPANN { int vectorCount = 0; std::shared_ptr vecStr; bool hasHead = false; + // Batched version-byte read for this posting + globalID head. + std::vector rf_vids; + rf_vids.reserve(postVectorNum + 1); + for (SizeType j = 0; j < postVectorNum; j++) { + rf_vids.push_back(*((SizeType*)(postingP + j * m_vectorInfoSize))); + } + rf_vids.push_back(globalID); + std::vector rf_mapVers; + m_versionMap->BatchGetVersions(rf_vids, rf_mapVers); for (int j = 0; j < postVectorNum; j++, vectorId += m_vectorInfoSize) { uint8_t version = *(vectorId + sizeof(SizeType)); - SizeType VID = *((SizeType *)(vectorId)); + SizeType VID = rf_vids[j]; if (VID == globalID) vecStr = std::make_shared((char*)vectorId + m_metaDataSize, m_vectorDataSize); - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != version) + uint8_t mapVer = rf_mapVers[j]; + if (mapVer == 0xfe || mapVer != version) continue; if (VID == globalID) hasHead = true; @@ -1159,7 +1199,7 @@ namespace SPTAG::SPANN { } if (!hasHead && vecStr != nullptr) { - Serialize((char*)postingP + vectorCount * m_vectorInfoSize, globalID, m_versionMap->GetVersion(globalID), vecStr->data()); + Serialize((char*)postingP + vectorCount * m_vectorInfoSize, globalID, rf_mapVers.back(), vecStr->data()); vectorCount++; } if (vectorCount <= m_mergeThreshold) mergelist.insert(globalID); @@ -1280,30 +1320,50 @@ namespace SPTAG::SPANN { localIndices.reserve(postVectorNum); uint8_t* vectorId = postingP; bool hasHead = false; - for (SizeType j = 0; j < postVectorNum; j++, vectorId += m_vectorInfoSize) + + // Pre-scan for invalid VIDs (treat as corruption marker + // that triggers retry of the GET, matching the original + // serial-loop behaviour) before issuing the batched + // version-byte read. { - //LOG(Helper::LogLevel::LL_Info, "vector index/total:id: %d/%d:%d\n", j, m_postingSizes[headID].load(), *(reinterpret_cast(vectorId))); - uint8_t version = *(vectorId + sizeof(SizeType)); - SizeType VID = *((SizeType*)(vectorId)); - if (VID < 0 || VID >= m_versionMap->Count()) - { - if (retry < 3) - { + bool sawInvalid = false; + SizeType maxVid = m_versionMap->Count(); + for (SizeType j = 0; j < postVectorNum; j++) { + SizeType VID = *((SizeType*)(postingP + j * m_vectorInfoSize)); + if (VID < 0 || VID >= maxVid) { sawInvalid = true; break; } + } + if (sawInvalid) { + if (retry < 3) { retry++; goto Retry; - } - else - { + } else { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, - "Split fail: Get posting %lld fail after 3 times retries.\n", (std::int64_t)(headID)); + "Split fail: Get posting %lld fail after 3 times retries.\n", (std::int64_t)headID); return ErrorCode::DiskIOFail; } } - + } + + // Batched MultiGet for every entry's version byte plus headID's. + std::vector sp_vids; + sp_vids.reserve(postVectorNum + 1); + for (SizeType j = 0; j < postVectorNum; j++) { + sp_vids.push_back(*((SizeType*)(postingP + j * m_vectorInfoSize))); + } + sp_vids.push_back(headID); + std::vector sp_mapVers; + m_versionMap->BatchGetVersions(sp_vids, sp_mapVers); + + for (SizeType j = 0; j < postVectorNum; j++, vectorId += m_vectorInfoSize) + { + //LOG(Helper::LogLevel::LL_Info, "vector index/total:id: %d/%d:%d\n", j, m_postingSizes[headID].load(), *(reinterpret_cast(vectorId))); + uint8_t version = *(vectorId + sizeof(SizeType)); + SizeType VID = sp_vids[j]; + if (VID == headID) headVec = std::make_shared((char*)vectorId, m_vectorInfoSize); - //if (VID >= m_versionMap.Count()) SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "DEBUG: vector ID:%d total size:%d\n", VID, m_versionMap.Count()); - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != version) continue; + uint8_t mapVer = sp_mapVers[j]; + if (mapVer == 0xfe || mapVer != version) continue; if (VID == headID) hasHead = true; localIndices.push_back(j); @@ -1312,7 +1372,7 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "Split fail: cannot find head in posting! headID:%lld\n", (std::int64_t)headID); return ErrorCode::Fail; } else { - *((uint8_t*)(headVec->data() + sizeof(SizeType))) = m_versionMap->GetVersion(headID); + *((uint8_t*)(headVec->data() + sizeof(SizeType))) = sp_mapVers.back(); } // double gcEndTime = sw.getElapsedMs(); // m_splitGcCost += gcEndTime; @@ -1676,10 +1736,19 @@ namespace SPTAG::SPANN { auto *postingK = reinterpret_cast(currentPostingList.data()); size_t newPostVectorNum = currentPostingList.size() / m_vectorInfoSize; + // Batched version-byte read for this posting we're merging into. + std::vector sm_vids; + sm_vids.reserve(newPostVectorNum); + for (size_t j = 0; j < newPostVectorNum; j++) { + sm_vids.push_back(*((SizeType*)(postingK + j * m_vectorInfoSize))); + } + std::vector sm_mapVers; + m_versionMap->BatchGetVersions(sm_vids, sm_mapVers); for (int j = 0; j < (int)newPostVectorNum; j++, postingK += m_vectorInfoSize) { - SizeType VID = *((SizeType *)(postingK)); + SizeType VID = sm_vids[j]; uint8_t verK = *(postingK + sizeof(SizeType)); - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != verK) continue; + uint8_t mapVer = sm_mapVers[j]; + if (mapVer == 0xfe || mapVer != verK) continue; if (vectorIdSet.find(VID) != vectorIdSet.end()) continue; vectorIdSet.insert(VID); mergedPostingList += currentPostingList.substr(j * m_vectorInfoSize, m_vectorInfoSize); @@ -2011,14 +2080,26 @@ namespace SPTAG::SPANN { int currentLength = 0; uint8_t* vectorId = postingP; std::shared_ptr headVec; - for (int j = 0; j < postVectorNum; j++, vectorId += m_vectorInfoSize) + // Batch one TiKV MultiGet for the entire posting's version + // bytes (plus the head's own version) instead of two serial + // TiKV roundtrips per entry. Last slot is headID's version. + std::vector mp_vids; + mp_vids.reserve(postVectorNum + 1); + for (size_t j = 0; j < postVectorNum; j++) { + mp_vids.push_back(*((SizeType*)(postingP + j * m_vectorInfoSize))); + } + mp_vids.push_back(headID); + std::vector mp_mapVers; + m_versionMap->BatchGetVersions(mp_vids, mp_mapVers); + for (int j = 0; j < (int)postVectorNum; j++, vectorId += m_vectorInfoSize) { - SizeType VID = *((SizeType*)(vectorId)); + SizeType VID = mp_vids[j]; uint8_t version = *(vectorId + sizeof(SizeType)); if (VID == headID) { headVec = std::make_shared((char*)vectorId, m_vectorInfoSize); } - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != version) continue; + uint8_t mapVer = mp_mapVers[j]; + if (mapVer == 0xfe || mapVer != version) continue; vectorIdSet.insert(VID); mergedPostingList += currentPostingList.substr(j * m_vectorInfoSize, m_vectorInfoSize); currentLength++; @@ -2028,7 +2109,7 @@ namespace SPTAG::SPANN { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "MergePostings fail: cannot find head vector in posting! headID:%lld\n", (std::int64_t)headID); return ErrorCode::Fail; } else { - *((uint8_t*)(headVec->data() + sizeof(SizeType))) = m_versionMap->GetVersion(headID); + *((uint8_t*)(headVec->data() + sizeof(SizeType))) = mp_mapVers.back(); } if (currentLength > m_mergeThreshold) @@ -2128,12 +2209,21 @@ namespace SPTAG::SPANN { postVectorNum = nextPostingList.size() / m_vectorInfoSize; vectorId = postingP; int nextLength = 0; - for (int j = 0; j < postVectorNum; j++, vectorId += m_vectorInfoSize) + // Batched version-byte read for this next posting. + std::vector mp_next_vids; + mp_next_vids.reserve(postVectorNum); + for (size_t j = 0; j < postVectorNum; j++) { + mp_next_vids.push_back(*((SizeType*)(postingP + j * m_vectorInfoSize))); + } + std::vector mp_next_mapVers; + m_versionMap->BatchGetVersions(mp_next_vids, mp_next_mapVers); + for (int j = 0; j < (int)postVectorNum; j++, vectorId += m_vectorInfoSize) { - SizeType VID = *((SizeType*)(vectorId)); + SizeType VID = mp_next_vids[j]; uint8_t version = *(vectorId + sizeof(SizeType)); if (VID == queryResult->VID) resultVec = std::make_shared((char*)vectorId, m_vectorInfoSize); - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != version) continue; + uint8_t mapVer = mp_next_mapVers[j]; + if (mapVer == 0xfe || mapVer != version) continue; if (vectorIdSet.find(VID) == vectorIdSet.end()) { nextVectorIdSet.insert(VID); mergedPostingList += nextPostingList.substr(j * m_vectorInfoSize, m_vectorInfoSize); @@ -2212,12 +2302,20 @@ namespace SPTAG::SPANN { if (!m_opt->m_disableReassign) { postingP = reinterpret_cast(deletedPostingList->data()); + // Batched version-byte read for the about-to-be-removed posting. + std::vector mp_del_vids; + mp_del_vids.reserve(deletedLength); + for (int j = 0; j < deletedLength; j++) { + mp_del_vids.push_back(*((SizeType*)(postingP + j * m_vectorInfoSize))); + } + std::vector mp_del_mapVers; + m_versionMap->BatchGetVersions(mp_del_vids, mp_del_mapVers); for (int j = 0; j < deletedLength; j++) { uint8_t* vectorId = postingP + j * m_vectorInfoSize; - SizeType VID = *(reinterpret_cast(vectorId)); uint8_t version = *(vectorId + sizeof(SizeType)); ValueType* vector = reinterpret_cast(vectorId + m_metaDataSize); - if (m_versionMap->Deleted(VID) || m_versionMap->GetVersion(VID) != version) continue; + uint8_t mapVer = mp_del_mapVers[j]; + if (mapVer == 0xfe || mapVer != version) continue; float origin_dist = m_headIndex->ComputeDistance(deletedHeadVec->data() + m_metaDataSize, vector); float current_dist = m_headIndex->ComputeDistance(nextHeadVec->data() + m_metaDataSize, vector); if (current_dist > origin_dist) { @@ -2408,19 +2506,28 @@ namespace SPTAG::SPANN { auto& postingList = postingLists[i]; size_t postVectorNum = postingList.size() / m_vectorInfoSize; auto* postingP = reinterpret_cast(postingList.data()); - for (int j = 0; j < postVectorNum; j++) { + // Batched version-byte read for the entire posting. + std::vector cr_vids; + cr_vids.reserve(postVectorNum); + for (size_t j = 0; j < postVectorNum; j++) { + cr_vids.push_back(*((SizeType*)(postingP + j * m_vectorInfoSize))); + } + std::vector cr_mapVers; + m_versionMap->BatchGetVersions(cr_vids, cr_mapVers); + const SizeType maxVid = m_versionMap->Count(); + for (size_t j = 0; j < postVectorNum; j++) { uint8_t* vectorId = postingP + j * m_vectorInfoSize; - SizeType vid = *(reinterpret_cast(vectorId)); + SizeType vid = cr_vids[j]; uint8_t version = *(reinterpret_cast(vectorId + sizeof(SizeType))); ValueType* vector = reinterpret_cast(vectorId + m_metaDataSize); - const SizeType maxVid = m_versionMap->Count(); if (vid < 0 || vid >= maxVid) { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "CollectReAssign: skip invalid VID %d (max %d) in posting headID=%d\n", vid, maxVid, newHeadsID[i]); continue; } - if (reAssignVectorsTopK.find(vid) == reAssignVectorsTopK.end() && !m_versionMap->Deleted(vid) && m_versionMap->GetVersion(vid) == version) { + uint8_t mapVer = cr_mapVers[j]; + if (reAssignVectorsTopK.find(vid) == reAssignVectorsTopK.end() && mapVer != 0xfe && mapVer == version) { m_stat.m_reAssignScanNum++; float dist = m_headIndex->ComputeDistance(newHeadsVec[i]->data(), vector); if (CheckIsNeedReassign(newHeadsVec, vector, headVector, newHeadsDist[i], dist, true)) { @@ -2485,19 +2592,28 @@ namespace SPTAG::SPANN { auto& postingList = nearbyPostings[i]; size_t postVectorNum = postingList.size() / m_vectorInfoSize; auto* postingP = reinterpret_cast(postingList.data()); - for (int j = 0; j < postVectorNum; j++) { + // Batched version-byte read for the nearby posting. + std::vector nb_vids; + nb_vids.reserve(postVectorNum); + for (size_t j = 0; j < postVectorNum; j++) { + nb_vids.push_back(*((SizeType*)(postingP + j * m_vectorInfoSize))); + } + std::vector nb_mapVers; + m_versionMap->BatchGetVersions(nb_vids, nb_mapVers); + const SizeType maxVid = m_versionMap->Count(); + for (size_t j = 0; j < postVectorNum; j++) { uint8_t* vectorId = postingP + j * m_vectorInfoSize; - SizeType vid = *(reinterpret_cast(vectorId)); + SizeType vid = nb_vids[j]; uint8_t version = *(reinterpret_cast(vectorId + sizeof(SizeType))); ValueType* vector = reinterpret_cast(vectorId + m_metaDataSize); - const SizeType maxVid = m_versionMap->Count(); if (vid < 0 || vid >= maxVid) { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "CollectReAssign(nearby): skip invalid VID %d (max %d) in posting headID=%d\n", vid, maxVid, HeadPrevTopK[i]); continue; } - if (reAssignVectorsTopK.find(vid) == reAssignVectorsTopK.end() && !m_versionMap->Deleted(vid) && m_versionMap->GetVersion(vid) == version) { + uint8_t mapVer = nb_mapVers[j]; + if (reAssignVectorsTopK.find(vid) == reAssignVectorsTopK.end() && mapVer != 0xfe && mapVer == version) { m_stat.m_reAssignScanNum++; float dist = m_headIndex->ComputeDistance(HeadPrevTopKVec[i]->data(), vector); if (CheckIsNeedReassign(newHeadsVec, vector, headVector, newHeadsDist[i], dist, false)) { From 450f7395a4b6ed3b7fd403746bf6cc9a78792bb3 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Tue, 16 Jun 2026 06:59:02 +0000 Subject: [PATCH 49/51] fix(distributed): correct version-map handling for striped global VIDs In distributed mode the TiKV version map is a shared global keyspace keyed by global VID, but Count() is a per-node local atomic. Global VIDs are striped across nodes, so a remote-owned VID legitimately exceeds the local Count(). Three issues stemmed from treating that as corruption / doing redundant per-head work: 1. Split pre-scan and CollectReAssign (ExtraDynamicSearcher.h) flagged VID >= local Count() as corruption, failing splits ("Get posting fail after 3 times retries") and skipping remote vectors in reassignment. Gate the upper-bound check to single-node; keep VID < 0 as the only distributed corruption marker. 2. SetVersionBatch (TiKVVersionMap.h) rejected vid >= count and dropped the writes (regression vs the original per-VID SetVersion loop, which only rejects vid < 0 and grows the count). This silently dropped version writes for remote-appended records, causing "SetVersionBatch: invalid key" floods. Restore original semantics: accept any vid >= 0 and EnsureCountAtLeast(maxKey+1). 3. The receiver-side BatchAppendCallback mirrored versions with a MultiGet + MultiPut per head, so a 20k-item chunk spanning many heads issued thousands of serial TiKV round-trips, stalling the append RPC and causing 180s remote-append timeouts. Hoist the mirror to a single MultiGet + MultiPut per chunk. Verified on 2-node insert_dominant (1M base + 0.5M insert): all three error classes resolved, post-insert recall 0.984 (baseline 0.976-0.986), healthy split/queue behavior, "No errors detected". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AnnService/inc/Core/Common/TiKVVersionMap.h | 16 ++++- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 62 ++++++++++++------- 2 files changed, 52 insertions(+), 26 deletions(-) diff --git a/AnnService/inc/Core/Common/TiKVVersionMap.h b/AnnService/inc/Core/Common/TiKVVersionMap.h index 42a56b8f2..cff9efb75 100644 --- a/AnnService/inc/Core/Common/TiKVVersionMap.h +++ b/AnnService/inc/Core/Common/TiKVVersionMap.h @@ -422,28 +422,38 @@ namespace SPTAG if (n == 0) return; SizeType count = m_count.load(); + SizeType maxKey = -1; std::vector keys; std::vector values; keys.reserve(n); values.reserve(n); for (size_t i = 0; i < n; ++i) { - if (vids[i] < 0 || vids[i] >= count) { + // Only a negative VID is a genuine torn/garbage read. In + // distributed mode global VIDs are striped across nodes and + // the version map is a shared global keyspace in TiKV, so a + // remote-owned VID >= the local Count() is legitimate (these + // calls exist precisely to mirror remote-appended records). + // Mirror SetVersion(): accept any vid >= 0 and grow the + // local count hint to cover it. + if (vids[i] < 0) { SPTAGLIB_LOG(Helper::LogLevel::LL_Error, "TiKVVersionMap::SetVersionBatch: invalid key %d (max %d)\n", vids[i], count); continue; } + if (vids[i] > maxKey) maxKey = vids[i]; keys.push_back(VersionKey(vids[i])); values.push_back(std::string(1, static_cast(versions[i]))); } if (keys.empty()) return; + if (maxKey >= 0) EnsureCountAtLeast(maxKey + 1); auto ret = m_db->MultiPut(keys, values, MaxTimeout, nullptr); if (ret == ErrorCode::Undefined) { // Backend lacks MultiPut: fall back to serial SetVersion // which preserves m_deleted accounting. for (size_t i = 0; i < n; ++i) { - if (vids[i] >= 0 && vids[i] < count) { + if (vids[i] >= 0) { SetVersion(vids[i], versions[i]); } } @@ -452,7 +462,7 @@ namespace SPTAG "TiKVVersionMap::SetVersionBatch: MultiPut failed layer=%d ret=%d keys=%zu; falling back to per-VID SetVersion.\n", m_layer, static_cast(ret), keys.size()); for (size_t i = 0; i < n; ++i) { - if (vids[i] >= 0 && vids[i] < count) { + if (vids[i] >= 0) { SetVersion(vids[i], versions[i]); } } diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index 074db7027..fb8d23176 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -655,6 +655,13 @@ namespace SPTAG::SPANN { // mirroring. Items refused at this phase count as // failures and are excluded from the MultiMerge. std::vector alive(items.size(), true); + // Accumulate every alive record's (vid, recVer) across the + // whole chunk so the version-map mirror is one MultiGet + + // one MultiPut for the entire chunk instead of a TiKV + // round-trip pair per head (which stalled the append RPC + // and caused remote-append timeouts under load). + std::vector chunkVids; + std::vector chunkRecVers; for (size_t i = 0; i < items.size(); ++i) { auto* req = items[i]; if (req->m_appendPosting.empty() || req->m_appendNum == 0) { @@ -680,41 +687,39 @@ namespace SPTAG::SPANN { req->m_headID, 0, dim, m_layer + 1, ws); } - // Mirror sender's versionMap for the records we're - // about to persist (otherwise MergePostings / - // SearchIndex would drop them as stale). + // Collect this record's (vid, recVer) for the + // chunk-wide version-map mirror issued after the loop. const uint8_t* basePtr = reinterpret_cast(req->m_appendPosting.data()); size_t totalRec = req->m_appendPosting.size() / m_vectorInfoSize; - std::vector candIdx; - std::vector candVids; - std::vector candRecVers; - candIdx.reserve(totalRec); - candVids.reserve(totalRec); - candRecVers.reserve(totalRec); for (size_t k = 0; k < totalRec; ++k) { const uint8_t* p = basePtr + k * m_vectorInfoSize; SizeType vid = *reinterpret_cast(p); uint8_t recVer = *(p + sizeof(SizeType)); if (vid < 0) continue; if (recVer == 0xfe) continue; - candIdx.push_back(k); - candVids.push_back(vid); - candRecVers.push_back(recVer); + chunkVids.push_back(vid); + chunkRecVers.push_back(recVer); } - std::vector curVers; - m_versionMap->BatchGetVersions(candVids, curVers); + } + // Chunk-wide version-map mirror: a single MultiGet to read + // current versions, then a single MultiPut for the records + // whose stored version differs (otherwise MergePostings / + // SearchIndex would drop them as stale). + if (!chunkVids.empty()) { + std::vector curVers; + m_versionMap->BatchGetVersions(chunkVids, curVers); std::vector batchVids; std::vector batchVers; - batchVids.reserve(candVids.size()); - batchVers.reserve(candVids.size()); - for (size_t k = 0; k < candVids.size(); ++k) { + batchVids.reserve(chunkVids.size()); + batchVers.reserve(chunkVids.size()); + for (size_t k = 0; k < chunkVids.size(); ++k) { uint8_t curVer = curVers[k]; if (curVer == 0xfe) continue; - if (curVer == candRecVers[k]) continue; - batchVids.push_back(candVids[k]); - batchVers.push_back(candRecVers[k]); + if (curVer == chunkRecVers[k]) continue; + batchVids.push_back(chunkVids[k]); + batchVers.push_back(chunkRecVers[k]); } if (!batchVids.empty()) { m_versionMap->SetVersionBatch(batchVids, batchVers); @@ -1344,10 +1349,19 @@ namespace SPTAG::SPANN { // version-byte read. { bool sawInvalid = false; + // In distributed mode the version map's Count() is a per-node + // local atomic. Global VIDs are striped across nodes, so a + // vector owned/inserted by another node (global VID >= local + // Count()) can be legitimately remote-appended into this + // node's posting without growing the local count. Only treat + // VID < 0 (a torn/garbage read) as corruption there; the + // upper-bound check is single-node only. Downstream + // BatchGetVersions handles out-of-range VIDs safely. + bool distributed = (m_worker && m_worker->IsEnabled()); SizeType maxVid = m_versionMap->Count(); for (SizeType j = 0; j < postVectorNum; j++) { SizeType VID = *((SizeType*)(postingP + j * m_vectorInfoSize)); - if (VID < 0 || VID >= maxVid) { sawInvalid = true; break; } + if (VID < 0 || (!distributed && VID >= maxVid)) { sawInvalid = true; break; } } if (sawInvalid) { if (retry < 3) { @@ -2522,12 +2536,13 @@ namespace SPTAG::SPANN { std::vector cr_mapVers; m_versionMap->BatchGetVersions(cr_vids, cr_mapVers); const SizeType maxVid = m_versionMap->Count(); + const bool distributed = (m_worker && m_worker->IsEnabled()); for (size_t j = 0; j < postVectorNum; j++) { uint8_t* vectorId = postingP + j * m_vectorInfoSize; SizeType vid = cr_vids[j]; uint8_t version = *(reinterpret_cast(vectorId + sizeof(SizeType))); ValueType* vector = reinterpret_cast(vectorId + m_metaDataSize); - if (vid < 0 || vid >= maxVid) { + if (vid < 0 || (!distributed && vid >= maxVid)) { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "CollectReAssign: skip invalid VID %lld in posting headID=%lld\n", (std::int64_t)vid, (std::int64_t)newHeadsID[i]); @@ -2608,12 +2623,13 @@ namespace SPTAG::SPANN { std::vector nb_mapVers; m_versionMap->BatchGetVersions(nb_vids, nb_mapVers); const SizeType maxVid = m_versionMap->Count(); + const bool distributed = (m_worker && m_worker->IsEnabled()); for (size_t j = 0; j < postVectorNum; j++) { uint8_t* vectorId = postingP + j * m_vectorInfoSize; SizeType vid = nb_vids[j]; uint8_t version = *(reinterpret_cast(vectorId + sizeof(SizeType))); ValueType* vector = reinterpret_cast(vectorId + m_metaDataSize); - if (vid < 0 || vid >= maxVid) { + if (vid < 0 || (!distributed && vid >= maxVid)) { SPTAGLIB_LOG(Helper::LogLevel::LL_Warning, "CollectReAssign(nearby): skip invalid VID %lld in posting headID=%lld\n", (std::int64_t)vid, (std::int64_t)HeadPrevTopK[i]); From 65ea07bf2a001ca7325e8dd77735bc95f646a40a Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Tue, 16 Jun 2026 08:00:42 +0000 Subject: [PATCH 50/51] perf(distributed): drop redundant receiver-side version-map mirror The distributed version map is a single shared TiKV keyspace (per-VID global keys, no local cache; tikvMap->SetDB(db) uses the same TiKV connection as the postings). The sender always establishes the authoritative version BEFORE sending a record: - new inserts use the default version (0x00 at layer 0), no write - reassign calls IncVersion(vid), committing to shared TiKV first The receiver-side mirror in the single-append and batch-append callbacks therefore only re-wrote values already globally visible in TiKV, adding write amplification with no recall benefit. It was the sole source of the per-head TiKV round-trips that stalled the append RPC and produced remote-append timeouts under load. Removing it (both callbacks) recovers insert throughput to 476 vec/s (2-node insert_dominant, 1M base + 1M insert) vs 315 with the batched mirror and 296 for the pre-merge baseline, while post-insert recall holds at 0.980 (baseline range 0.976-0.986) with zero invalid-key, zero split retries, and append timeouts down to a transient 2. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../inc/Core/SPANN/ExtraDynamicSearcher.h | 103 ++---------------- 1 file changed, 12 insertions(+), 91 deletions(-) diff --git a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h index fb8d23176..d27a6e6af 100644 --- a/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h +++ b/AnnService/inc/Core/SPANN/ExtraDynamicSearcher.h @@ -588,49 +588,13 @@ namespace SPTAG::SPANN { } } - // Mirror sender's version map for the records we're about - // to persist so MergePostings + SearchIndex don't drop - // them as "stale". - { - const uint8_t* basePtr = reinterpret_cast(appendPosting.data()); - size_t totalRec = appendPosting.size() / m_vectorInfoSize; - - // Pre-build the candidate set and batch-read current - // versions to avoid one TiKV Get per record. - std::vector candIdx; - std::vector candVids; - std::vector candRecVers; - candIdx.reserve(totalRec); - candVids.reserve(totalRec); - candRecVers.reserve(totalRec); - for (size_t i = 0; i < totalRec; ++i) { - const uint8_t* p = basePtr + i * m_vectorInfoSize; - SizeType vid = *reinterpret_cast(p); - uint8_t recVer = *(p + sizeof(SizeType)); - if (vid < 0) continue; - if (recVer == 0xfe) continue; - candIdx.push_back(i); - candVids.push_back(vid); - candRecVers.push_back(recVer); - } - std::vector curVers; - m_versionMap->BatchGetVersions(candVids, curVers); - - std::vector batchVids; - std::vector batchVers; - batchVids.reserve(candVids.size()); - batchVers.reserve(candVids.size()); - for (size_t k = 0; k < candVids.size(); ++k) { - uint8_t curVer = curVers[k]; - if (curVer == 0xfe) continue; - if (curVer == candRecVers[k]) continue; - batchVids.push_back(candVids[k]); - batchVers.push_back(candRecVers[k]); - } - if (!batchVids.empty()) { - m_versionMap->SetVersionBatch(batchVids, batchVers); - } - } + // No receiver-side version-map mirror: the distributed + // version map is a single shared TiKV keyspace (per-VID + // global keys, no local cache) and the sender already + // established the authoritative version before sending + // (IncVersion on reassign; default version for new + // inserts). Re-writing it here is redundant and only adds + // TiKV write amplification. return Append(ws, headID, appendNum, appendPosting, 0, /*p_skipRemoteBucketWait=*/fencingToken != 0); }); @@ -651,17 +615,12 @@ namespace SPTAG::SPANN { } // Phase 1: per-head prep (race-condition wait, - // resurrection or refusal) and per-item versionMap - // mirroring. Items refused at this phase count as - // failures and are excluded from the MultiMerge. + // resurrection or refusal). Items refused at this phase + // count as failures and are excluded from the MultiMerge. + // No receiver-side version-map mirror: the shared TiKV + // version map already holds the sender's authoritative + // version (see single-append callback above). std::vector alive(items.size(), true); - // Accumulate every alive record's (vid, recVer) across the - // whole chunk so the version-map mirror is one MultiGet + - // one MultiPut for the entire chunk instead of a TiKV - // round-trip pair per head (which stalled the append RPC - // and caused remote-append timeouts under load). - std::vector chunkVids; - std::vector chunkRecVers; for (size_t i = 0; i < items.size(); ++i) { auto* req = items[i]; if (req->m_appendPosting.empty() || req->m_appendNum == 0) { @@ -686,44 +645,6 @@ namespace SPTAG::SPANN { m_headIndex->AddHeadIndex(req->m_headVec.data(), req->m_headID, 0, dim, m_layer + 1, ws); } - - // Collect this record's (vid, recVer) for the - // chunk-wide version-map mirror issued after the loop. - const uint8_t* basePtr = - reinterpret_cast(req->m_appendPosting.data()); - size_t totalRec = req->m_appendPosting.size() / m_vectorInfoSize; - for (size_t k = 0; k < totalRec; ++k) { - const uint8_t* p = basePtr + k * m_vectorInfoSize; - SizeType vid = *reinterpret_cast(p); - uint8_t recVer = *(p + sizeof(SizeType)); - if (vid < 0) continue; - if (recVer == 0xfe) continue; - chunkVids.push_back(vid); - chunkRecVers.push_back(recVer); - } - } - - // Chunk-wide version-map mirror: a single MultiGet to read - // current versions, then a single MultiPut for the records - // whose stored version differs (otherwise MergePostings / - // SearchIndex would drop them as stale). - if (!chunkVids.empty()) { - std::vector curVers; - m_versionMap->BatchGetVersions(chunkVids, curVers); - std::vector batchVids; - std::vector batchVers; - batchVids.reserve(chunkVids.size()); - batchVers.reserve(chunkVids.size()); - for (size_t k = 0; k < chunkVids.size(); ++k) { - uint8_t curVer = curVers[k]; - if (curVer == 0xfe) continue; - if (curVer == chunkRecVers[k]) continue; - batchVids.push_back(chunkVids[k]); - batchVers.push_back(chunkRecVers[k]); - } - if (!batchVids.empty()) { - m_versionMap->SetVersionBatch(batchVids, batchVers); - } } // Phase 2: group surviving items by headID, then From 7f9964d5f804581e7576bf32043938688a735149 Mon Sep 17 00:00:00 2001 From: TerrenceZhangX <39916879+TerrenceZhangX@users.noreply.github.com> Date: Tue, 16 Jun 2026 08:07:32 +0000 Subject: [PATCH 51/51] chore: stop tracking generated kvproto C++ stubs The generated/ protobuf+gRPC stubs were committed before ThirdParty/kvproto/.gitignore was added, so they stayed tracked. They are environment-specific (must match the protoc/grpc versions of the build env) and are meant to be regenerated locally via generate_cpp.sh. Untrack them (local copies preserved); the existing .gitignore keeps them out going forward. The .proto sources and generate_cpp.sh remain tracked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../generated/kvproto/errorpb.grpc.pb.cc | 25 - .../generated/kvproto/errorpb.grpc.pb.h | 37 - .../kvproto/generated/kvproto/errorpb.pb.cc | 2489 ---- .../kvproto/generated/kvproto/errorpb.pb.h | 3315 ----- .../generated/kvproto/kvrpcpb.grpc.pb.cc | 25 - .../generated/kvproto/kvrpcpb.grpc.pb.h | 37 - .../kvproto/generated/kvproto/kvrpcpb.pb.cc | 8115 ------------ .../kvproto/generated/kvproto/kvrpcpb.pb.h | 11006 ---------------- .../generated/kvproto/metapb.grpc.pb.cc | 25 - .../generated/kvproto/metapb.grpc.pb.h | 37 - .../kvproto/generated/kvproto/metapb.pb.cc | 2082 --- .../kvproto/generated/kvproto/metapb.pb.h | 2693 ---- .../kvproto/generated/kvproto/pdpb.grpc.pb.cc | 212 - .../kvproto/generated/kvproto/pdpb.grpc.pb.h | 716 - .../kvproto/generated/kvproto/pdpb.pb.cc | 3153 ----- .../kvproto/generated/kvproto/pdpb.pb.h | 4187 ------ .../generated/kvproto/tikvpb.grpc.pb.cc | 464 - .../generated/kvproto/tikvpb.grpc.pb.h | 1661 --- .../kvproto/generated/kvproto/tikvpb.pb.cc | 103 - .../kvproto/generated/kvproto/tikvpb.pb.h | 92 - 20 files changed, 40474 deletions(-) delete mode 100644 ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/errorpb.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/errorpb.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/metapb.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/metapb.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/pdpb.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/pdpb.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.h delete mode 100644 ThirdParty/kvproto/generated/kvproto/tikvpb.pb.cc delete mode 100644 ThirdParty/kvproto/generated/kvproto/tikvpb.pb.h diff --git a/ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.cc b/ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.cc deleted file mode 100644 index 88da0e07a..000000000 --- a/ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: errorpb.proto - -#include "errorpb.pb.h" -#include "errorpb.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace errorpb { - -} // namespace errorpb - diff --git a/ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.h b/ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.h deleted file mode 100644 index d5111ecfb..000000000 --- a/ThirdParty/kvproto/generated/kvproto/errorpb.grpc.pb.h +++ /dev/null @@ -1,37 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: errorpb.proto -// Original file comments: -// Extracted from https://github.com/pingcap/kvproto -// Minimal definitions for SPANN TiKV integration - error handling types. -// -#ifndef GRPC_errorpb_2eproto__INCLUDED -#define GRPC_errorpb_2eproto__INCLUDED - -#include "errorpb.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace errorpb { - -} // namespace errorpb - - -#endif // GRPC_errorpb_2eproto__INCLUDED diff --git a/ThirdParty/kvproto/generated/kvproto/errorpb.pb.cc b/ThirdParty/kvproto/generated/kvproto/errorpb.pb.cc deleted file mode 100644 index 118f4c847..000000000 --- a/ThirdParty/kvproto/generated/kvproto/errorpb.pb.cc +++ /dev/null @@ -1,2489 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: errorpb.proto - -#include "errorpb.pb.h" - -#include -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/extension_set.h" -#include "google/protobuf/wire_format_lite.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/reflection_ops.h" -#include "google/protobuf/wire_format.h" -#include "google/protobuf/generated_message_tctable_impl.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" -PROTOBUF_PRAGMA_INIT_SEG -namespace _pb = ::google::protobuf; -namespace _pbi = ::google::protobuf::internal; -namespace _fl = ::google::protobuf::internal::field_layout; -namespace errorpb { - -inline constexpr StoreNotMatch::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : request_store_id_{::uint64_t{0u}}, - actual_store_id_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR StoreNotMatch::StoreNotMatch(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct StoreNotMatchDefaultTypeInternal { - PROTOBUF_CONSTEXPR StoreNotMatchDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~StoreNotMatchDefaultTypeInternal() {} - union { - StoreNotMatch _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StoreNotMatchDefaultTypeInternal _StoreNotMatch_default_instance_; - template -PROTOBUF_CONSTEXPR StaleCommand::StaleCommand(::_pbi::ConstantInitialized) {} -struct StaleCommandDefaultTypeInternal { - PROTOBUF_CONSTEXPR StaleCommandDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~StaleCommandDefaultTypeInternal() {} - union { - StaleCommand _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StaleCommandDefaultTypeInternal _StaleCommand_default_instance_; - -inline constexpr ServerIsBusy::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : reason_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - backoff_ms_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR ServerIsBusy::ServerIsBusy(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct ServerIsBusyDefaultTypeInternal { - PROTOBUF_CONSTEXPR ServerIsBusyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~ServerIsBusyDefaultTypeInternal() {} - union { - ServerIsBusy _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServerIsBusyDefaultTypeInternal _ServerIsBusy_default_instance_; - -inline constexpr RegionNotFound::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : region_id_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR RegionNotFound::RegionNotFound(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RegionNotFoundDefaultTypeInternal { - PROTOBUF_CONSTEXPR RegionNotFoundDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RegionNotFoundDefaultTypeInternal() {} - union { - RegionNotFound _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionNotFoundDefaultTypeInternal _RegionNotFound_default_instance_; - -inline constexpr RaftEntryTooLarge::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : region_id_{::uint64_t{0u}}, - entry_size_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR RaftEntryTooLarge::RaftEntryTooLarge(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RaftEntryTooLargeDefaultTypeInternal { - PROTOBUF_CONSTEXPR RaftEntryTooLargeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RaftEntryTooLargeDefaultTypeInternal() {} - union { - RaftEntryTooLarge _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RaftEntryTooLargeDefaultTypeInternal _RaftEntryTooLarge_default_instance_; - -inline constexpr KeyNotInRegion::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - start_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - end_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_id_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR KeyNotInRegion::KeyNotInRegion(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct KeyNotInRegionDefaultTypeInternal { - PROTOBUF_CONSTEXPR KeyNotInRegionDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~KeyNotInRegionDefaultTypeInternal() {} - union { - KeyNotInRegion _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KeyNotInRegionDefaultTypeInternal _KeyNotInRegion_default_instance_; - -inline constexpr NotLeader::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - leader_{nullptr}, - region_id_{::uint64_t{0u}} {} - -template -PROTOBUF_CONSTEXPR NotLeader::NotLeader(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct NotLeaderDefaultTypeInternal { - PROTOBUF_CONSTEXPR NotLeaderDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~NotLeaderDefaultTypeInternal() {} - union { - NotLeader _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NotLeaderDefaultTypeInternal _NotLeader_default_instance_; - -inline constexpr EpochNotMatch::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : current_regions_{}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR EpochNotMatch::EpochNotMatch(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct EpochNotMatchDefaultTypeInternal { - PROTOBUF_CONSTEXPR EpochNotMatchDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~EpochNotMatchDefaultTypeInternal() {} - union { - EpochNotMatch _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EpochNotMatchDefaultTypeInternal _EpochNotMatch_default_instance_; - -inline constexpr Error::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - message_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - not_leader_{nullptr}, - region_not_found_{nullptr}, - key_not_in_region_{nullptr}, - epoch_not_match_{nullptr}, - server_is_busy_{nullptr}, - stale_command_{nullptr}, - store_not_match_{nullptr}, - raft_entry_too_large_{nullptr} {} - -template -PROTOBUF_CONSTEXPR Error::Error(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct ErrorDefaultTypeInternal { - PROTOBUF_CONSTEXPR ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~ErrorDefaultTypeInternal() {} - union { - Error _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ErrorDefaultTypeInternal _Error_default_instance_; -} // namespace errorpb -static ::_pb::Metadata file_level_metadata_errorpb_2eproto[9]; -static constexpr const ::_pb::EnumDescriptor** - file_level_enum_descriptors_errorpb_2eproto = nullptr; -static constexpr const ::_pb::ServiceDescriptor** - file_level_service_descriptors_errorpb_2eproto = nullptr; -const ::uint32_t TableStruct_errorpb_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( - protodesc_cold) = { - PROTOBUF_FIELD_OFFSET(::errorpb::NotLeader, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::errorpb::NotLeader, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::NotLeader, _impl_.region_id_), - PROTOBUF_FIELD_OFFSET(::errorpb::NotLeader, _impl_.leader_), - ~0u, - 0, - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::errorpb::StoreNotMatch, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::StoreNotMatch, _impl_.request_store_id_), - PROTOBUF_FIELD_OFFSET(::errorpb::StoreNotMatch, _impl_.actual_store_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::errorpb::RegionNotFound, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::RegionNotFound, _impl_.region_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::errorpb::KeyNotInRegion, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::KeyNotInRegion, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::errorpb::KeyNotInRegion, _impl_.region_id_), - PROTOBUF_FIELD_OFFSET(::errorpb::KeyNotInRegion, _impl_.start_key_), - PROTOBUF_FIELD_OFFSET(::errorpb::KeyNotInRegion, _impl_.end_key_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::errorpb::EpochNotMatch, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::EpochNotMatch, _impl_.current_regions_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::errorpb::ServerIsBusy, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::ServerIsBusy, _impl_.reason_), - PROTOBUF_FIELD_OFFSET(::errorpb::ServerIsBusy, _impl_.backoff_ms_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::errorpb::StaleCommand, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::errorpb::RaftEntryTooLarge, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::RaftEntryTooLarge, _impl_.region_id_), - PROTOBUF_FIELD_OFFSET(::errorpb::RaftEntryTooLarge, _impl_.entry_size_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.message_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.not_leader_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.region_not_found_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.key_not_in_region_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.epoch_not_match_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.server_is_busy_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.stale_command_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.store_not_match_), - PROTOBUF_FIELD_OFFSET(::errorpb::Error, _impl_.raft_entry_too_large_), - ~0u, - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, -}; - -static const ::_pbi::MigrationSchema - schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, 10, -1, sizeof(::errorpb::NotLeader)}, - {12, -1, -1, sizeof(::errorpb::StoreNotMatch)}, - {22, -1, -1, sizeof(::errorpb::RegionNotFound)}, - {31, -1, -1, sizeof(::errorpb::KeyNotInRegion)}, - {43, -1, -1, sizeof(::errorpb::EpochNotMatch)}, - {52, -1, -1, sizeof(::errorpb::ServerIsBusy)}, - {62, -1, -1, sizeof(::errorpb::StaleCommand)}, - {70, -1, -1, sizeof(::errorpb::RaftEntryTooLarge)}, - {80, 97, -1, sizeof(::errorpb::Error)}, -}; - -static const ::_pb::Message* const file_default_instances[] = { - &::errorpb::_NotLeader_default_instance_._instance, - &::errorpb::_StoreNotMatch_default_instance_._instance, - &::errorpb::_RegionNotFound_default_instance_._instance, - &::errorpb::_KeyNotInRegion_default_instance_._instance, - &::errorpb::_EpochNotMatch_default_instance_._instance, - &::errorpb::_ServerIsBusy_default_instance_._instance, - &::errorpb::_StaleCommand_default_instance_._instance, - &::errorpb::_RaftEntryTooLarge_default_instance_._instance, - &::errorpb::_Error_default_instance_._instance, -}; -const char descriptor_table_protodef_errorpb_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\rerrorpb.proto\022\007errorpb\032\014metapb.proto\"<" - "\n\tNotLeader\022\021\n\tregion_id\030\001 \001(\004\022\034\n\006leader" - "\030\002 \001(\0132\014.metapb.Peer\"B\n\rStoreNotMatch\022\030\n" - "\020request_store_id\030\001 \001(\004\022\027\n\017actual_store_" - "id\030\002 \001(\004\"#\n\016RegionNotFound\022\021\n\tregion_id\030" - "\001 \001(\004\"T\n\016KeyNotInRegion\022\013\n\003key\030\001 \001(\014\022\021\n\t" - "region_id\030\002 \001(\004\022\021\n\tstart_key\030\003 \001(\014\022\017\n\007en" - "d_key\030\004 \001(\014\"8\n\rEpochNotMatch\022\'\n\017current_" - "regions\030\001 \003(\0132\016.metapb.Region\"2\n\014ServerI" - "sBusy\022\016\n\006reason\030\001 \001(\t\022\022\n\nbackoff_ms\030\002 \001(" - "\004\"\016\n\014StaleCommand\":\n\021RaftEntryTooLarge\022\021" - "\n\tregion_id\030\001 \001(\004\022\022\n\nentry_size\030\002 \001(\004\"\240\003" - "\n\005Error\022\017\n\007message\030\001 \001(\t\022&\n\nnot_leader\030\002" - " \001(\0132\022.errorpb.NotLeader\0221\n\020region_not_f" - "ound\030\003 \001(\0132\027.errorpb.RegionNotFound\0222\n\021k" - "ey_not_in_region\030\004 \001(\0132\027.errorpb.KeyNotI" - "nRegion\022/\n\017epoch_not_match\030\005 \001(\0132\026.error" - "pb.EpochNotMatch\022-\n\016server_is_busy\030\006 \001(\013" - "2\025.errorpb.ServerIsBusy\022,\n\rstale_command" - "\030\007 \001(\0132\025.errorpb.StaleCommand\022/\n\017store_n" - "ot_match\030\010 \001(\0132\026.errorpb.StoreNotMatch\0228" - "\n\024raft_entry_too_large\030\t \001(\0132\032.errorpb.R" - "aftEntryTooLargeB\022\n\020org.tikv.kvprotob\006pr" - "oto3" -}; -static const ::_pbi::DescriptorTable* const descriptor_table_errorpb_2eproto_deps[1] = - { - &::descriptor_table_metapb_2eproto, -}; -static ::absl::once_flag descriptor_table_errorpb_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_errorpb_2eproto = { - false, - false, - 924, - descriptor_table_protodef_errorpb_2eproto, - "errorpb.proto", - &descriptor_table_errorpb_2eproto_once, - descriptor_table_errorpb_2eproto_deps, - 1, - 9, - schemas, - file_default_instances, - TableStruct_errorpb_2eproto::offsets, - file_level_metadata_errorpb_2eproto, - file_level_enum_descriptors_errorpb_2eproto, - file_level_service_descriptors_errorpb_2eproto, -}; - -// This function exists to be marked as weak. -// It can significantly speed up compilation by breaking up LLVM's SCC -// in the .pb.cc translation units. Large translation units see a -// reduction of more than 35% of walltime for optimized builds. Without -// the weak attribute all the messages in the file, including all the -// vtables and everything they use become part of the same SCC through -// a cycle like: -// GetMetadata -> descriptor table -> default instances -> -// vtables -> GetMetadata -// By adding a weak function here we break the connection from the -// individual vtables back into the descriptor table. -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_errorpb_2eproto_getter() { - return &descriptor_table_errorpb_2eproto; -} -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 -static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_errorpb_2eproto(&descriptor_table_errorpb_2eproto); -namespace errorpb { -// =================================================================== - -class NotLeader::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(NotLeader, _impl_._has_bits_); - static const ::metapb::Peer& leader(const NotLeader* msg); - static void set_has_leader(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::metapb::Peer& NotLeader::_Internal::leader(const NotLeader* msg) { - return *msg->_impl_.leader_; -} -void NotLeader::clear_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.leader_ != nullptr) _impl_.leader_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -NotLeader::NotLeader(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.NotLeader) -} -inline PROTOBUF_NDEBUG_INLINE NotLeader::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0} {} - -NotLeader::NotLeader( - ::google::protobuf::Arena* arena, - const NotLeader& from) - : ::google::protobuf::Message(arena) { - NotLeader* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.leader_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::metapb::Peer>(arena, *from._impl_.leader_) - : nullptr; - _impl_.region_id_ = from._impl_.region_id_; - - // @@protoc_insertion_point(copy_constructor:errorpb.NotLeader) -} -inline PROTOBUF_NDEBUG_INLINE NotLeader::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void NotLeader::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, leader_), - 0, - offsetof(Impl_, region_id_) - - offsetof(Impl_, leader_) + - sizeof(Impl_::region_id_)); -} -NotLeader::~NotLeader() { - // @@protoc_insertion_point(destructor:errorpb.NotLeader) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void NotLeader::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.leader_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void NotLeader::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.NotLeader) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.leader_ != nullptr); - _impl_.leader_->Clear(); - } - _impl_.region_id_ = ::uint64_t{0u}; - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* NotLeader::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> NotLeader::_table_ = { - { - PROTOBUF_FIELD_OFFSET(NotLeader, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_NotLeader_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // .metapb.Peer leader = 2; - {::_pbi::TcParser::FastMtS1, - {18, 0, 0, PROTOBUF_FIELD_OFFSET(NotLeader, _impl_.leader_)}}, - // uint64 region_id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(NotLeader, _impl_.region_id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(NotLeader, _impl_.region_id_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 region_id = 1; - {PROTOBUF_FIELD_OFFSET(NotLeader, _impl_.region_id_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // .metapb.Peer leader = 2; - {PROTOBUF_FIELD_OFFSET(NotLeader, _impl_.leader_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::metapb::Peer>()}, - }}, {{ - }}, -}; - -::uint8_t* NotLeader::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.NotLeader) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_region_id(), target); - } - - cached_has_bits = _impl_._has_bits_[0]; - // .metapb.Peer leader = 2; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 2, _Internal::leader(this), - _Internal::leader(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.NotLeader) - return target; -} - -::size_t NotLeader::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.NotLeader) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .metapb.Peer leader = 2; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.leader_); - } - - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_region_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData NotLeader::_class_data_ = { - NotLeader::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* NotLeader::GetClassData() const { - return &_class_data_; -} - -void NotLeader::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.NotLeader) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_leader()->::metapb::Peer::MergeFrom( - from._internal_leader()); - } - if (from._internal_region_id() != 0) { - _this->_internal_set_region_id(from._internal_region_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void NotLeader::CopyFrom(const NotLeader& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.NotLeader) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool NotLeader::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* NotLeader::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void NotLeader::InternalSwap(NotLeader* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(NotLeader, _impl_.region_id_) - + sizeof(NotLeader::_impl_.region_id_) - - PROTOBUF_FIELD_OFFSET(NotLeader, _impl_.leader_)>( - reinterpret_cast(&_impl_.leader_), - reinterpret_cast(&other->_impl_.leader_)); -} - -::google::protobuf::Metadata NotLeader::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[0]); -} -// =================================================================== - -class StoreNotMatch::_Internal { - public: -}; - -StoreNotMatch::StoreNotMatch(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.StoreNotMatch) -} -StoreNotMatch::StoreNotMatch( - ::google::protobuf::Arena* arena, const StoreNotMatch& from) - : StoreNotMatch(arena) { - MergeFrom(from); -} -inline PROTOBUF_NDEBUG_INLINE StoreNotMatch::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void StoreNotMatch::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, request_store_id_), - 0, - offsetof(Impl_, actual_store_id_) - - offsetof(Impl_, request_store_id_) + - sizeof(Impl_::actual_store_id_)); -} -StoreNotMatch::~StoreNotMatch() { - // @@protoc_insertion_point(destructor:errorpb.StoreNotMatch) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void StoreNotMatch::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void StoreNotMatch::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.StoreNotMatch) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&_impl_.request_store_id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.actual_store_id_) - - reinterpret_cast(&_impl_.request_store_id_)) + sizeof(_impl_.actual_store_id_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* StoreNotMatch::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 0, 2> StoreNotMatch::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_StoreNotMatch_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 actual_store_id = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(StoreNotMatch, _impl_.actual_store_id_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(StoreNotMatch, _impl_.actual_store_id_)}}, - // uint64 request_store_id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(StoreNotMatch, _impl_.request_store_id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(StoreNotMatch, _impl_.request_store_id_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 request_store_id = 1; - {PROTOBUF_FIELD_OFFSET(StoreNotMatch, _impl_.request_store_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // uint64 actual_store_id = 2; - {PROTOBUF_FIELD_OFFSET(StoreNotMatch, _impl_.actual_store_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* StoreNotMatch::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.StoreNotMatch) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 request_store_id = 1; - if (this->_internal_request_store_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_request_store_id(), target); - } - - // uint64 actual_store_id = 2; - if (this->_internal_actual_store_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_actual_store_id(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.StoreNotMatch) - return target; -} - -::size_t StoreNotMatch::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.StoreNotMatch) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 request_store_id = 1; - if (this->_internal_request_store_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_request_store_id()); - } - - // uint64 actual_store_id = 2; - if (this->_internal_actual_store_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_actual_store_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData StoreNotMatch::_class_data_ = { - StoreNotMatch::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* StoreNotMatch::GetClassData() const { - return &_class_data_; -} - -void StoreNotMatch::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.StoreNotMatch) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_request_store_id() != 0) { - _this->_internal_set_request_store_id(from._internal_request_store_id()); - } - if (from._internal_actual_store_id() != 0) { - _this->_internal_set_actual_store_id(from._internal_actual_store_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void StoreNotMatch::CopyFrom(const StoreNotMatch& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.StoreNotMatch) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool StoreNotMatch::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* StoreNotMatch::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void StoreNotMatch::InternalSwap(StoreNotMatch* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(StoreNotMatch, _impl_.actual_store_id_) - + sizeof(StoreNotMatch::_impl_.actual_store_id_) - - PROTOBUF_FIELD_OFFSET(StoreNotMatch, _impl_.request_store_id_)>( - reinterpret_cast(&_impl_.request_store_id_), - reinterpret_cast(&other->_impl_.request_store_id_)); -} - -::google::protobuf::Metadata StoreNotMatch::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[1]); -} -// =================================================================== - -class RegionNotFound::_Internal { - public: -}; - -RegionNotFound::RegionNotFound(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.RegionNotFound) -} -RegionNotFound::RegionNotFound( - ::google::protobuf::Arena* arena, const RegionNotFound& from) - : RegionNotFound(arena) { - MergeFrom(from); -} -inline PROTOBUF_NDEBUG_INLINE RegionNotFound::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void RegionNotFound::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_id_ = {}; -} -RegionNotFound::~RegionNotFound() { - // @@protoc_insertion_point(destructor:errorpb.RegionNotFound) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RegionNotFound::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RegionNotFound::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.RegionNotFound) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.region_id_ = ::uint64_t{0u}; - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RegionNotFound::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 1, 0, 0, 2> RegionNotFound::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 1, 0, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967294, // skipmap - offsetof(decltype(_table_), field_entries), - 1, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_RegionNotFound_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 region_id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RegionNotFound, _impl_.region_id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(RegionNotFound, _impl_.region_id_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 region_id = 1; - {PROTOBUF_FIELD_OFFSET(RegionNotFound, _impl_.region_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* RegionNotFound::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.RegionNotFound) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_region_id(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.RegionNotFound) - return target; -} - -::size_t RegionNotFound::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.RegionNotFound) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_region_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RegionNotFound::_class_data_ = { - RegionNotFound::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RegionNotFound::GetClassData() const { - return &_class_data_; -} - -void RegionNotFound::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.RegionNotFound) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_region_id() != 0) { - _this->_internal_set_region_id(from._internal_region_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RegionNotFound::CopyFrom(const RegionNotFound& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.RegionNotFound) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RegionNotFound::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RegionNotFound::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RegionNotFound::InternalSwap(RegionNotFound* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.region_id_, other->_impl_.region_id_); -} - -::google::protobuf::Metadata RegionNotFound::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[2]); -} -// =================================================================== - -class KeyNotInRegion::_Internal { - public: -}; - -KeyNotInRegion::KeyNotInRegion(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.KeyNotInRegion) -} -inline PROTOBUF_NDEBUG_INLINE KeyNotInRegion::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : key_(arena, from.key_), - start_key_(arena, from.start_key_), - end_key_(arena, from.end_key_), - _cached_size_{0} {} - -KeyNotInRegion::KeyNotInRegion( - ::google::protobuf::Arena* arena, - const KeyNotInRegion& from) - : ::google::protobuf::Message(arena) { - KeyNotInRegion* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - _impl_.region_id_ = from._impl_.region_id_; - - // @@protoc_insertion_point(copy_constructor:errorpb.KeyNotInRegion) -} -inline PROTOBUF_NDEBUG_INLINE KeyNotInRegion::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : key_(arena), - start_key_(arena), - end_key_(arena), - _cached_size_{0} {} - -inline void KeyNotInRegion::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_id_ = {}; -} -KeyNotInRegion::~KeyNotInRegion() { - // @@protoc_insertion_point(destructor:errorpb.KeyNotInRegion) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void KeyNotInRegion::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.key_.Destroy(); - _impl_.start_key_.Destroy(); - _impl_.end_key_.Destroy(); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void KeyNotInRegion::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.KeyNotInRegion) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.key_.ClearToEmpty(); - _impl_.start_key_.ClearToEmpty(); - _impl_.end_key_.ClearToEmpty(); - _impl_.region_id_ = ::uint64_t{0u}; - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* KeyNotInRegion::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 0, 2> KeyNotInRegion::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap - offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_KeyNotInRegion_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bytes end_key = 4; - {::_pbi::TcParser::FastBS1, - {34, 63, 0, PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.end_key_)}}, - // bytes key = 1; - {::_pbi::TcParser::FastBS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.key_)}}, - // uint64 region_id = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(KeyNotInRegion, _impl_.region_id_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.region_id_)}}, - // bytes start_key = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.start_key_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // bytes key = 1; - {PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.key_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // uint64 region_id = 2; - {PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.region_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // bytes start_key = 3; - {PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.start_key_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes end_key = 4; - {PROTOBUF_FIELD_OFFSET(KeyNotInRegion, _impl_.end_key_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* KeyNotInRegion::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.KeyNotInRegion) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // bytes key = 1; - if (!this->_internal_key().empty()) { - const std::string& _s = this->_internal_key(); - target = stream->WriteBytesMaybeAliased(1, _s, target); - } - - // uint64 region_id = 2; - if (this->_internal_region_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_region_id(), target); - } - - // bytes start_key = 3; - if (!this->_internal_start_key().empty()) { - const std::string& _s = this->_internal_start_key(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - // bytes end_key = 4; - if (!this->_internal_end_key().empty()) { - const std::string& _s = this->_internal_end_key(); - target = stream->WriteBytesMaybeAliased(4, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.KeyNotInRegion) - return target; -} - -::size_t KeyNotInRegion::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.KeyNotInRegion) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 1; - if (!this->_internal_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_key()); - } - - // bytes start_key = 3; - if (!this->_internal_start_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_start_key()); - } - - // bytes end_key = 4; - if (!this->_internal_end_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_end_key()); - } - - // uint64 region_id = 2; - if (this->_internal_region_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_region_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData KeyNotInRegion::_class_data_ = { - KeyNotInRegion::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* KeyNotInRegion::GetClassData() const { - return &_class_data_; -} - -void KeyNotInRegion::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.KeyNotInRegion) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_key().empty()) { - _this->_internal_set_key(from._internal_key()); - } - if (!from._internal_start_key().empty()) { - _this->_internal_set_start_key(from._internal_start_key()); - } - if (!from._internal_end_key().empty()) { - _this->_internal_set_end_key(from._internal_end_key()); - } - if (from._internal_region_id() != 0) { - _this->_internal_set_region_id(from._internal_region_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void KeyNotInRegion::CopyFrom(const KeyNotInRegion& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.KeyNotInRegion) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool KeyNotInRegion::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* KeyNotInRegion::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void KeyNotInRegion::InternalSwap(KeyNotInRegion* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.start_key_, &other->_impl_.start_key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.end_key_, &other->_impl_.end_key_, arena); - swap(_impl_.region_id_, other->_impl_.region_id_); -} - -::google::protobuf::Metadata KeyNotInRegion::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[3]); -} -// =================================================================== - -class EpochNotMatch::_Internal { - public: -}; - -void EpochNotMatch::clear_current_regions() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.current_regions_.Clear(); -} -EpochNotMatch::EpochNotMatch(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.EpochNotMatch) -} -inline PROTOBUF_NDEBUG_INLINE EpochNotMatch::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : current_regions_{visibility, arena, from.current_regions_}, - _cached_size_{0} {} - -EpochNotMatch::EpochNotMatch( - ::google::protobuf::Arena* arena, - const EpochNotMatch& from) - : ::google::protobuf::Message(arena) { - EpochNotMatch* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - - // @@protoc_insertion_point(copy_constructor:errorpb.EpochNotMatch) -} -inline PROTOBUF_NDEBUG_INLINE EpochNotMatch::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : current_regions_{visibility, arena}, - _cached_size_{0} {} - -inline void EpochNotMatch::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); -} -EpochNotMatch::~EpochNotMatch() { - // @@protoc_insertion_point(destructor:errorpb.EpochNotMatch) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void EpochNotMatch::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void EpochNotMatch::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.EpochNotMatch) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.current_regions_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* EpochNotMatch::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 1, 1, 0, 2> EpochNotMatch::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 1, 0, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967294, // skipmap - offsetof(decltype(_table_), field_entries), - 1, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_EpochNotMatch_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // repeated .metapb.Region current_regions = 1; - {::_pbi::TcParser::FastMtR1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(EpochNotMatch, _impl_.current_regions_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // repeated .metapb.Region current_regions = 1; - {PROTOBUF_FIELD_OFFSET(EpochNotMatch, _impl_.current_regions_), 0, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::metapb::Region>()}, - }}, {{ - }}, -}; - -::uint8_t* EpochNotMatch::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.EpochNotMatch) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // repeated .metapb.Region current_regions = 1; - for (unsigned i = 0, - n = static_cast(this->_internal_current_regions_size()); i < n; i++) { - const auto& repfield = this->_internal_current_regions().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.EpochNotMatch) - return target; -} - -::size_t EpochNotMatch::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.EpochNotMatch) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .metapb.Region current_regions = 1; - total_size += 1UL * this->_internal_current_regions_size(); - for (const auto& msg : this->_internal_current_regions()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData EpochNotMatch::_class_data_ = { - EpochNotMatch::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* EpochNotMatch::GetClassData() const { - return &_class_data_; -} - -void EpochNotMatch::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.EpochNotMatch) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_current_regions()->MergeFrom( - from._internal_current_regions()); - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void EpochNotMatch::CopyFrom(const EpochNotMatch& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.EpochNotMatch) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool EpochNotMatch::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* EpochNotMatch::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void EpochNotMatch::InternalSwap(EpochNotMatch* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.current_regions_.InternalSwap(&other->_impl_.current_regions_); -} - -::google::protobuf::Metadata EpochNotMatch::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[4]); -} -// =================================================================== - -class ServerIsBusy::_Internal { - public: -}; - -ServerIsBusy::ServerIsBusy(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.ServerIsBusy) -} -inline PROTOBUF_NDEBUG_INLINE ServerIsBusy::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : reason_(arena, from.reason_), - _cached_size_{0} {} - -ServerIsBusy::ServerIsBusy( - ::google::protobuf::Arena* arena, - const ServerIsBusy& from) - : ::google::protobuf::Message(arena) { - ServerIsBusy* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - _impl_.backoff_ms_ = from._impl_.backoff_ms_; - - // @@protoc_insertion_point(copy_constructor:errorpb.ServerIsBusy) -} -inline PROTOBUF_NDEBUG_INLINE ServerIsBusy::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : reason_(arena), - _cached_size_{0} {} - -inline void ServerIsBusy::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.backoff_ms_ = {}; -} -ServerIsBusy::~ServerIsBusy() { - // @@protoc_insertion_point(destructor:errorpb.ServerIsBusy) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void ServerIsBusy::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.reason_.Destroy(); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void ServerIsBusy::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.ServerIsBusy) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.reason_.ClearToEmpty(); - _impl_.backoff_ms_ = ::uint64_t{0u}; - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* ServerIsBusy::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 35, 2> ServerIsBusy::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_ServerIsBusy_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 backoff_ms = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ServerIsBusy, _impl_.backoff_ms_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(ServerIsBusy, _impl_.backoff_ms_)}}, - // string reason = 1; - {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(ServerIsBusy, _impl_.reason_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // string reason = 1; - {PROTOBUF_FIELD_OFFSET(ServerIsBusy, _impl_.reason_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint64 backoff_ms = 2; - {PROTOBUF_FIELD_OFFSET(ServerIsBusy, _impl_.backoff_ms_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - "\24\6\0\0\0\0\0\0" - "errorpb.ServerIsBusy" - "reason" - }}, -}; - -::uint8_t* ServerIsBusy::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.ServerIsBusy) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // string reason = 1; - if (!this->_internal_reason().empty()) { - const std::string& _s = this->_internal_reason(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "errorpb.ServerIsBusy.reason"); - target = stream->WriteStringMaybeAliased(1, _s, target); - } - - // uint64 backoff_ms = 2; - if (this->_internal_backoff_ms() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_backoff_ms(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.ServerIsBusy) - return target; -} - -::size_t ServerIsBusy::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.ServerIsBusy) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string reason = 1; - if (!this->_internal_reason().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_reason()); - } - - // uint64 backoff_ms = 2; - if (this->_internal_backoff_ms() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_backoff_ms()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData ServerIsBusy::_class_data_ = { - ServerIsBusy::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* ServerIsBusy::GetClassData() const { - return &_class_data_; -} - -void ServerIsBusy::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.ServerIsBusy) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_reason().empty()) { - _this->_internal_set_reason(from._internal_reason()); - } - if (from._internal_backoff_ms() != 0) { - _this->_internal_set_backoff_ms(from._internal_backoff_ms()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void ServerIsBusy::CopyFrom(const ServerIsBusy& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.ServerIsBusy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool ServerIsBusy::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* ServerIsBusy::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void ServerIsBusy::InternalSwap(ServerIsBusy* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.reason_, &other->_impl_.reason_, arena); - swap(_impl_.backoff_ms_, other->_impl_.backoff_ms_); -} - -::google::protobuf::Metadata ServerIsBusy::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[5]); -} -// =================================================================== - -class StaleCommand::_Internal { - public: -}; - -StaleCommand::StaleCommand(::google::protobuf::Arena* arena) - : ::google::protobuf::internal::ZeroFieldsBase(arena) { - // @@protoc_insertion_point(arena_constructor:errorpb.StaleCommand) -} -StaleCommand::StaleCommand( - ::google::protobuf::Arena* arena, - const StaleCommand& from) - : ::google::protobuf::internal::ZeroFieldsBase(arena) { - StaleCommand* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - - // @@protoc_insertion_point(copy_constructor:errorpb.StaleCommand) -} - - - - - - - - - -::google::protobuf::Metadata StaleCommand::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[6]); -} -// =================================================================== - -class RaftEntryTooLarge::_Internal { - public: -}; - -RaftEntryTooLarge::RaftEntryTooLarge(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.RaftEntryTooLarge) -} -RaftEntryTooLarge::RaftEntryTooLarge( - ::google::protobuf::Arena* arena, const RaftEntryTooLarge& from) - : RaftEntryTooLarge(arena) { - MergeFrom(from); -} -inline PROTOBUF_NDEBUG_INLINE RaftEntryTooLarge::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void RaftEntryTooLarge::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, region_id_), - 0, - offsetof(Impl_, entry_size_) - - offsetof(Impl_, region_id_) + - sizeof(Impl_::entry_size_)); -} -RaftEntryTooLarge::~RaftEntryTooLarge() { - // @@protoc_insertion_point(destructor:errorpb.RaftEntryTooLarge) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RaftEntryTooLarge::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RaftEntryTooLarge::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.RaftEntryTooLarge) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&_impl_.region_id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.entry_size_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.entry_size_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RaftEntryTooLarge::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 0, 2> RaftEntryTooLarge::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_RaftEntryTooLarge_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 entry_size = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RaftEntryTooLarge, _impl_.entry_size_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(RaftEntryTooLarge, _impl_.entry_size_)}}, - // uint64 region_id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RaftEntryTooLarge, _impl_.region_id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(RaftEntryTooLarge, _impl_.region_id_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 region_id = 1; - {PROTOBUF_FIELD_OFFSET(RaftEntryTooLarge, _impl_.region_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // uint64 entry_size = 2; - {PROTOBUF_FIELD_OFFSET(RaftEntryTooLarge, _impl_.entry_size_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* RaftEntryTooLarge::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.RaftEntryTooLarge) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_region_id(), target); - } - - // uint64 entry_size = 2; - if (this->_internal_entry_size() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_entry_size(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.RaftEntryTooLarge) - return target; -} - -::size_t RaftEntryTooLarge::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.RaftEntryTooLarge) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_region_id()); - } - - // uint64 entry_size = 2; - if (this->_internal_entry_size() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_entry_size()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RaftEntryTooLarge::_class_data_ = { - RaftEntryTooLarge::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RaftEntryTooLarge::GetClassData() const { - return &_class_data_; -} - -void RaftEntryTooLarge::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.RaftEntryTooLarge) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_region_id() != 0) { - _this->_internal_set_region_id(from._internal_region_id()); - } - if (from._internal_entry_size() != 0) { - _this->_internal_set_entry_size(from._internal_entry_size()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RaftEntryTooLarge::CopyFrom(const RaftEntryTooLarge& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.RaftEntryTooLarge) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RaftEntryTooLarge::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RaftEntryTooLarge::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RaftEntryTooLarge::InternalSwap(RaftEntryTooLarge* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RaftEntryTooLarge, _impl_.entry_size_) - + sizeof(RaftEntryTooLarge::_impl_.entry_size_) - - PROTOBUF_FIELD_OFFSET(RaftEntryTooLarge, _impl_.region_id_)>( - reinterpret_cast(&_impl_.region_id_), - reinterpret_cast(&other->_impl_.region_id_)); -} - -::google::protobuf::Metadata RaftEntryTooLarge::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[7]); -} -// =================================================================== - -class Error::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(Error, _impl_._has_bits_); - static const ::errorpb::NotLeader& not_leader(const Error* msg); - static void set_has_not_leader(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::errorpb::RegionNotFound& region_not_found(const Error* msg); - static void set_has_region_not_found(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static const ::errorpb::KeyNotInRegion& key_not_in_region(const Error* msg); - static void set_has_key_not_in_region(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } - static const ::errorpb::EpochNotMatch& epoch_not_match(const Error* msg); - static void set_has_epoch_not_match(HasBits* has_bits) { - (*has_bits)[0] |= 8u; - } - static const ::errorpb::ServerIsBusy& server_is_busy(const Error* msg); - static void set_has_server_is_busy(HasBits* has_bits) { - (*has_bits)[0] |= 16u; - } - static const ::errorpb::StaleCommand& stale_command(const Error* msg); - static void set_has_stale_command(HasBits* has_bits) { - (*has_bits)[0] |= 32u; - } - static const ::errorpb::StoreNotMatch& store_not_match(const Error* msg); - static void set_has_store_not_match(HasBits* has_bits) { - (*has_bits)[0] |= 64u; - } - static const ::errorpb::RaftEntryTooLarge& raft_entry_too_large(const Error* msg); - static void set_has_raft_entry_too_large(HasBits* has_bits) { - (*has_bits)[0] |= 128u; - } -}; - -const ::errorpb::NotLeader& Error::_Internal::not_leader(const Error* msg) { - return *msg->_impl_.not_leader_; -} -const ::errorpb::RegionNotFound& Error::_Internal::region_not_found(const Error* msg) { - return *msg->_impl_.region_not_found_; -} -const ::errorpb::KeyNotInRegion& Error::_Internal::key_not_in_region(const Error* msg) { - return *msg->_impl_.key_not_in_region_; -} -const ::errorpb::EpochNotMatch& Error::_Internal::epoch_not_match(const Error* msg) { - return *msg->_impl_.epoch_not_match_; -} -const ::errorpb::ServerIsBusy& Error::_Internal::server_is_busy(const Error* msg) { - return *msg->_impl_.server_is_busy_; -} -const ::errorpb::StaleCommand& Error::_Internal::stale_command(const Error* msg) { - return *msg->_impl_.stale_command_; -} -const ::errorpb::StoreNotMatch& Error::_Internal::store_not_match(const Error* msg) { - return *msg->_impl_.store_not_match_; -} -const ::errorpb::RaftEntryTooLarge& Error::_Internal::raft_entry_too_large(const Error* msg) { - return *msg->_impl_.raft_entry_too_large_; -} -Error::Error(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:errorpb.Error) -} -inline PROTOBUF_NDEBUG_INLINE Error::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - message_(arena, from.message_) {} - -Error::Error( - ::google::protobuf::Arena* arena, - const Error& from) - : ::google::protobuf::Message(arena) { - Error* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.not_leader_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::NotLeader>(arena, *from._impl_.not_leader_) - : nullptr; - _impl_.region_not_found_ = (cached_has_bits & 0x00000002u) - ? CreateMaybeMessage<::errorpb::RegionNotFound>(arena, *from._impl_.region_not_found_) - : nullptr; - _impl_.key_not_in_region_ = (cached_has_bits & 0x00000004u) - ? CreateMaybeMessage<::errorpb::KeyNotInRegion>(arena, *from._impl_.key_not_in_region_) - : nullptr; - _impl_.epoch_not_match_ = (cached_has_bits & 0x00000008u) - ? CreateMaybeMessage<::errorpb::EpochNotMatch>(arena, *from._impl_.epoch_not_match_) - : nullptr; - _impl_.server_is_busy_ = (cached_has_bits & 0x00000010u) - ? CreateMaybeMessage<::errorpb::ServerIsBusy>(arena, *from._impl_.server_is_busy_) - : nullptr; - _impl_.stale_command_ = (cached_has_bits & 0x00000020u) - ? CreateMaybeMessage<::errorpb::StaleCommand>(arena, *from._impl_.stale_command_) - : nullptr; - _impl_.store_not_match_ = (cached_has_bits & 0x00000040u) - ? CreateMaybeMessage<::errorpb::StoreNotMatch>(arena, *from._impl_.store_not_match_) - : nullptr; - _impl_.raft_entry_too_large_ = (cached_has_bits & 0x00000080u) - ? CreateMaybeMessage<::errorpb::RaftEntryTooLarge>(arena, *from._impl_.raft_entry_too_large_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:errorpb.Error) -} -inline PROTOBUF_NDEBUG_INLINE Error::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - message_(arena) {} - -inline void Error::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, not_leader_), - 0, - offsetof(Impl_, raft_entry_too_large_) - - offsetof(Impl_, not_leader_) + - sizeof(Impl_::raft_entry_too_large_)); -} -Error::~Error() { - // @@protoc_insertion_point(destructor:errorpb.Error) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Error::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.message_.Destroy(); - delete _impl_.not_leader_; - delete _impl_.region_not_found_; - delete _impl_.key_not_in_region_; - delete _impl_.epoch_not_match_; - delete _impl_.server_is_busy_; - delete _impl_.stale_command_; - delete _impl_.store_not_match_; - delete _impl_.raft_entry_too_large_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Error::Clear() { -// @@protoc_insertion_point(message_clear_start:errorpb.Error) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.message_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.not_leader_ != nullptr); - _impl_.not_leader_->Clear(); - } - if (cached_has_bits & 0x00000002u) { - ABSL_DCHECK(_impl_.region_not_found_ != nullptr); - _impl_.region_not_found_->Clear(); - } - if (cached_has_bits & 0x00000004u) { - ABSL_DCHECK(_impl_.key_not_in_region_ != nullptr); - _impl_.key_not_in_region_->Clear(); - } - if (cached_has_bits & 0x00000008u) { - ABSL_DCHECK(_impl_.epoch_not_match_ != nullptr); - _impl_.epoch_not_match_->Clear(); - } - if (cached_has_bits & 0x00000010u) { - ABSL_DCHECK(_impl_.server_is_busy_ != nullptr); - _impl_.server_is_busy_->Clear(); - } - if (cached_has_bits & 0x00000020u) { - ABSL_DCHECK(_impl_.stale_command_ != nullptr); - _impl_.stale_command_->Clear(); - } - if (cached_has_bits & 0x00000040u) { - ABSL_DCHECK(_impl_.store_not_match_ != nullptr); - _impl_.store_not_match_->Clear(); - } - if (cached_has_bits & 0x00000080u) { - ABSL_DCHECK(_impl_.raft_entry_too_large_ != nullptr); - _impl_.raft_entry_too_large_->Clear(); - } - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Error::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<4, 9, 8, 37, 2> Error::_table_ = { - { - PROTOBUF_FIELD_OFFSET(Error, _impl_._has_bits_), - 0, // no _extensions_ - 9, 120, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294966784, // skipmap - offsetof(decltype(_table_), field_entries), - 9, // num_field_entries - 8, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_Error_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string message = 1; - {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Error, _impl_.message_)}}, - // .errorpb.NotLeader not_leader = 2; - {::_pbi::TcParser::FastMtS1, - {18, 0, 0, PROTOBUF_FIELD_OFFSET(Error, _impl_.not_leader_)}}, - // .errorpb.RegionNotFound region_not_found = 3; - {::_pbi::TcParser::FastMtS1, - {26, 1, 1, PROTOBUF_FIELD_OFFSET(Error, _impl_.region_not_found_)}}, - // .errorpb.KeyNotInRegion key_not_in_region = 4; - {::_pbi::TcParser::FastMtS1, - {34, 2, 2, PROTOBUF_FIELD_OFFSET(Error, _impl_.key_not_in_region_)}}, - // .errorpb.EpochNotMatch epoch_not_match = 5; - {::_pbi::TcParser::FastMtS1, - {42, 3, 3, PROTOBUF_FIELD_OFFSET(Error, _impl_.epoch_not_match_)}}, - // .errorpb.ServerIsBusy server_is_busy = 6; - {::_pbi::TcParser::FastMtS1, - {50, 4, 4, PROTOBUF_FIELD_OFFSET(Error, _impl_.server_is_busy_)}}, - // .errorpb.StaleCommand stale_command = 7; - {::_pbi::TcParser::FastMdS1, - {58, 5, 5, PROTOBUF_FIELD_OFFSET(Error, _impl_.stale_command_)}}, - // .errorpb.StoreNotMatch store_not_match = 8; - {::_pbi::TcParser::FastMtS1, - {66, 6, 6, PROTOBUF_FIELD_OFFSET(Error, _impl_.store_not_match_)}}, - // .errorpb.RaftEntryTooLarge raft_entry_too_large = 9; - {::_pbi::TcParser::FastMtS1, - {74, 7, 7, PROTOBUF_FIELD_OFFSET(Error, _impl_.raft_entry_too_large_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // string message = 1; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.message_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .errorpb.NotLeader not_leader = 2; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.not_leader_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .errorpb.RegionNotFound region_not_found = 3; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.region_not_found_), _Internal::kHasBitsOffset + 1, 1, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .errorpb.KeyNotInRegion key_not_in_region = 4; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.key_not_in_region_), _Internal::kHasBitsOffset + 2, 2, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .errorpb.EpochNotMatch epoch_not_match = 5; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.epoch_not_match_), _Internal::kHasBitsOffset + 3, 3, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .errorpb.ServerIsBusy server_is_busy = 6; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.server_is_busy_), _Internal::kHasBitsOffset + 4, 4, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .errorpb.StaleCommand stale_command = 7; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.stale_command_), _Internal::kHasBitsOffset + 5, 5, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvDefault)}, - // .errorpb.StoreNotMatch store_not_match = 8; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.store_not_match_), _Internal::kHasBitsOffset + 6, 6, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .errorpb.RaftEntryTooLarge raft_entry_too_large = 9; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.raft_entry_too_large_), _Internal::kHasBitsOffset + 7, 7, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::NotLeader>()}, - {::_pbi::TcParser::GetTable<::errorpb::RegionNotFound>()}, - {::_pbi::TcParser::GetTable<::errorpb::KeyNotInRegion>()}, - {::_pbi::TcParser::GetTable<::errorpb::EpochNotMatch>()}, - {::_pbi::TcParser::GetTable<::errorpb::ServerIsBusy>()}, - {::_pbi::FieldAuxDefaultMessage{}, &::errorpb::_StaleCommand_default_instance_}, - {::_pbi::TcParser::GetTable<::errorpb::StoreNotMatch>()}, - {::_pbi::TcParser::GetTable<::errorpb::RaftEntryTooLarge>()}, - }}, {{ - "\15\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "errorpb.Error" - "message" - }}, -}; - -::uint8_t* Error::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:errorpb.Error) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // string message = 1; - if (!this->_internal_message().empty()) { - const std::string& _s = this->_internal_message(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "errorpb.Error.message"); - target = stream->WriteStringMaybeAliased(1, _s, target); - } - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.NotLeader not_leader = 2; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 2, _Internal::not_leader(this), - _Internal::not_leader(this).GetCachedSize(), target, stream); - } - - // .errorpb.RegionNotFound region_not_found = 3; - if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 3, _Internal::region_not_found(this), - _Internal::region_not_found(this).GetCachedSize(), target, stream); - } - - // .errorpb.KeyNotInRegion key_not_in_region = 4; - if (cached_has_bits & 0x00000004u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 4, _Internal::key_not_in_region(this), - _Internal::key_not_in_region(this).GetCachedSize(), target, stream); - } - - // .errorpb.EpochNotMatch epoch_not_match = 5; - if (cached_has_bits & 0x00000008u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 5, _Internal::epoch_not_match(this), - _Internal::epoch_not_match(this).GetCachedSize(), target, stream); - } - - // .errorpb.ServerIsBusy server_is_busy = 6; - if (cached_has_bits & 0x00000010u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 6, _Internal::server_is_busy(this), - _Internal::server_is_busy(this).GetCachedSize(), target, stream); - } - - // .errorpb.StaleCommand stale_command = 7; - if (cached_has_bits & 0x00000020u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 7, _Internal::stale_command(this), - _Internal::stale_command(this).GetCachedSize(), target, stream); - } - - // .errorpb.StoreNotMatch store_not_match = 8; - if (cached_has_bits & 0x00000040u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 8, _Internal::store_not_match(this), - _Internal::store_not_match(this).GetCachedSize(), target, stream); - } - - // .errorpb.RaftEntryTooLarge raft_entry_too_large = 9; - if (cached_has_bits & 0x00000080u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 9, _Internal::raft_entry_too_large(this), - _Internal::raft_entry_too_large(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:errorpb.Error) - return target; -} - -::size_t Error::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:errorpb.Error) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string message = 1; - if (!this->_internal_message().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_message()); - } - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - // .errorpb.NotLeader not_leader = 2; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.not_leader_); - } - - // .errorpb.RegionNotFound region_not_found = 3; - if (cached_has_bits & 0x00000002u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_not_found_); - } - - // .errorpb.KeyNotInRegion key_not_in_region = 4; - if (cached_has_bits & 0x00000004u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.key_not_in_region_); - } - - // .errorpb.EpochNotMatch epoch_not_match = 5; - if (cached_has_bits & 0x00000008u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.epoch_not_match_); - } - - // .errorpb.ServerIsBusy server_is_busy = 6; - if (cached_has_bits & 0x00000010u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.server_is_busy_); - } - - // .errorpb.StaleCommand stale_command = 7; - if (cached_has_bits & 0x00000020u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.stale_command_); - } - - // .errorpb.StoreNotMatch store_not_match = 8; - if (cached_has_bits & 0x00000040u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.store_not_match_); - } - - // .errorpb.RaftEntryTooLarge raft_entry_too_large = 9; - if (cached_has_bits & 0x00000080u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.raft_entry_too_large_); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Error::_class_data_ = { - Error::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Error::GetClassData() const { - return &_class_data_; -} - -void Error::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:errorpb.Error) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_message().empty()) { - _this->_internal_set_message(from._internal_message()); - } - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x000000ffu) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_not_leader()->::errorpb::NotLeader::MergeFrom( - from._internal_not_leader()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_region_not_found()->::errorpb::RegionNotFound::MergeFrom( - from._internal_region_not_found()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_key_not_in_region()->::errorpb::KeyNotInRegion::MergeFrom( - from._internal_key_not_in_region()); - } - if (cached_has_bits & 0x00000008u) { - _this->_internal_mutable_epoch_not_match()->::errorpb::EpochNotMatch::MergeFrom( - from._internal_epoch_not_match()); - } - if (cached_has_bits & 0x00000010u) { - _this->_internal_mutable_server_is_busy()->::errorpb::ServerIsBusy::MergeFrom( - from._internal_server_is_busy()); - } - if (cached_has_bits & 0x00000020u) { - _this->_internal_mutable_stale_command()->::errorpb::StaleCommand::MergeFrom( - from._internal_stale_command()); - } - if (cached_has_bits & 0x00000040u) { - _this->_internal_mutable_store_not_match()->::errorpb::StoreNotMatch::MergeFrom( - from._internal_store_not_match()); - } - if (cached_has_bits & 0x00000080u) { - _this->_internal_mutable_raft_entry_too_large()->::errorpb::RaftEntryTooLarge::MergeFrom( - from._internal_raft_entry_too_large()); - } - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Error::CopyFrom(const Error& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:errorpb.Error) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Error::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Error::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Error::InternalSwap(Error* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.message_, &other->_impl_.message_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Error, _impl_.raft_entry_too_large_) - + sizeof(Error::_impl_.raft_entry_too_large_) - - PROTOBUF_FIELD_OFFSET(Error, _impl_.not_leader_)>( - reinterpret_cast(&_impl_.not_leader_), - reinterpret_cast(&other->_impl_.not_leader_)); -} - -::google::protobuf::Metadata Error::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_errorpb_2eproto_getter, &descriptor_table_errorpb_2eproto_once, - file_level_metadata_errorpb_2eproto[8]); -} -// @@protoc_insertion_point(namespace_scope) -} // namespace errorpb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google -// @@protoc_insertion_point(global_scope) -#include "google/protobuf/port_undef.inc" diff --git a/ThirdParty/kvproto/generated/kvproto/errorpb.pb.h b/ThirdParty/kvproto/generated/kvproto/errorpb.pb.h deleted file mode 100644 index 67ef010d1..000000000 --- a/ThirdParty/kvproto/generated/kvproto/errorpb.pb.h +++ /dev/null @@ -1,3315 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: errorpb.proto -// Protobuf C++ Version: 4.25.3 - -#ifndef GOOGLE_PROTOBUF_INCLUDED_errorpb_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_errorpb_2eproto_2epb_2eh - -#include -#include -#include -#include - -#include "google/protobuf/port_def.inc" -#if PROTOBUF_VERSION < 4025000 -#error "This file was generated by a newer version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please update" -#error "your headers." -#endif // PROTOBUF_VERSION - -#if 4025003 < PROTOBUF_MIN_PROTOC_VERSION -#error "This file was generated by an older version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please" -#error "regenerate this file with a newer version of protoc." -#endif // PROTOBUF_MIN_PROTOC_VERSION -#include "google/protobuf/port_undef.inc" -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/arena.h" -#include "google/protobuf/arenastring.h" -#include "google/protobuf/generated_message_bases.h" -#include "google/protobuf/generated_message_tctable_decl.h" -#include "google/protobuf/generated_message_util.h" -#include "google/protobuf/metadata_lite.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/message.h" -#include "google/protobuf/repeated_field.h" // IWYU pragma: export -#include "google/protobuf/extension_set.h" // IWYU pragma: export -#include "google/protobuf/unknown_field_set.h" -#include "metapb.pb.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" - -#define PROTOBUF_INTERNAL_EXPORT_errorpb_2eproto - -namespace google { -namespace protobuf { -namespace internal { -class AnyMetadata; -} // namespace internal -} // namespace protobuf -} // namespace google - -// Internal implementation detail -- do not use these members. -struct TableStruct_errorpb_2eproto { - static const ::uint32_t offsets[]; -}; -extern const ::google::protobuf::internal::DescriptorTable - descriptor_table_errorpb_2eproto; -namespace errorpb { -class EpochNotMatch; -struct EpochNotMatchDefaultTypeInternal; -extern EpochNotMatchDefaultTypeInternal _EpochNotMatch_default_instance_; -class Error; -struct ErrorDefaultTypeInternal; -extern ErrorDefaultTypeInternal _Error_default_instance_; -class KeyNotInRegion; -struct KeyNotInRegionDefaultTypeInternal; -extern KeyNotInRegionDefaultTypeInternal _KeyNotInRegion_default_instance_; -class NotLeader; -struct NotLeaderDefaultTypeInternal; -extern NotLeaderDefaultTypeInternal _NotLeader_default_instance_; -class RaftEntryTooLarge; -struct RaftEntryTooLargeDefaultTypeInternal; -extern RaftEntryTooLargeDefaultTypeInternal _RaftEntryTooLarge_default_instance_; -class RegionNotFound; -struct RegionNotFoundDefaultTypeInternal; -extern RegionNotFoundDefaultTypeInternal _RegionNotFound_default_instance_; -class ServerIsBusy; -struct ServerIsBusyDefaultTypeInternal; -extern ServerIsBusyDefaultTypeInternal _ServerIsBusy_default_instance_; -class StaleCommand; -struct StaleCommandDefaultTypeInternal; -extern StaleCommandDefaultTypeInternal _StaleCommand_default_instance_; -class StoreNotMatch; -struct StoreNotMatchDefaultTypeInternal; -extern StoreNotMatchDefaultTypeInternal _StoreNotMatch_default_instance_; -} // namespace errorpb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google - -namespace errorpb { - -// =================================================================== - - -// ------------------------------------------------------------------- - -class StoreNotMatch final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.StoreNotMatch) */ { - public: - inline StoreNotMatch() : StoreNotMatch(nullptr) {} - ~StoreNotMatch() override; - template - explicit PROTOBUF_CONSTEXPR StoreNotMatch(::google::protobuf::internal::ConstantInitialized); - - inline StoreNotMatch(const StoreNotMatch& from) - : StoreNotMatch(nullptr, from) {} - StoreNotMatch(StoreNotMatch&& from) noexcept - : StoreNotMatch() { - *this = ::std::move(from); - } - - inline StoreNotMatch& operator=(const StoreNotMatch& from) { - CopyFrom(from); - return *this; - } - inline StoreNotMatch& operator=(StoreNotMatch&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const StoreNotMatch& default_instance() { - return *internal_default_instance(); - } - static inline const StoreNotMatch* internal_default_instance() { - return reinterpret_cast( - &_StoreNotMatch_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(StoreNotMatch& a, StoreNotMatch& b) { - a.Swap(&b); - } - inline void Swap(StoreNotMatch* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StoreNotMatch* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - StoreNotMatch* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const StoreNotMatch& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const StoreNotMatch& from) { - StoreNotMatch::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(StoreNotMatch* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.StoreNotMatch"; - } - protected: - explicit StoreNotMatch(::google::protobuf::Arena* arena); - StoreNotMatch(::google::protobuf::Arena* arena, const StoreNotMatch& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRequestStoreIdFieldNumber = 1, - kActualStoreIdFieldNumber = 2, - }; - // uint64 request_store_id = 1; - void clear_request_store_id() ; - ::uint64_t request_store_id() const; - void set_request_store_id(::uint64_t value); - - private: - ::uint64_t _internal_request_store_id() const; - void _internal_set_request_store_id(::uint64_t value); - - public: - // uint64 actual_store_id = 2; - void clear_actual_store_id() ; - ::uint64_t actual_store_id() const; - void set_actual_store_id(::uint64_t value); - - private: - ::uint64_t _internal_actual_store_id() const; - void _internal_set_actual_store_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:errorpb.StoreNotMatch) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::uint64_t request_store_id_; - ::uint64_t actual_store_id_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class StaleCommand final : - public ::google::protobuf::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:errorpb.StaleCommand) */ { - public: - inline StaleCommand() : StaleCommand(nullptr) {} - template - explicit PROTOBUF_CONSTEXPR StaleCommand(::google::protobuf::internal::ConstantInitialized); - - inline StaleCommand(const StaleCommand& from) - : StaleCommand(nullptr, from) {} - StaleCommand(StaleCommand&& from) noexcept - : StaleCommand() { - *this = ::std::move(from); - } - - inline StaleCommand& operator=(const StaleCommand& from) { - CopyFrom(from); - return *this; - } - inline StaleCommand& operator=(StaleCommand&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const StaleCommand& default_instance() { - return *internal_default_instance(); - } - static inline const StaleCommand* internal_default_instance() { - return reinterpret_cast( - &_StaleCommand_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(StaleCommand& a, StaleCommand& b) { - a.Swap(&b); - } - inline void Swap(StaleCommand* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StaleCommand* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - StaleCommand* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const StaleCommand& from) { - ::google::protobuf::internal::ZeroFieldsBase::CopyImpl(*this, from); - } - using ::google::protobuf::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const StaleCommand& from) { - ::google::protobuf::internal::ZeroFieldsBase::MergeImpl(*this, from); - } - public: - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.StaleCommand"; - } - protected: - explicit StaleCommand(::google::protobuf::Arena* arena); - StaleCommand(::google::protobuf::Arena* arena, const StaleCommand& from); - public: - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // @@protoc_insertion_point(class_scope:errorpb.StaleCommand) - private: - class _Internal; - - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - PROTOBUF_TSAN_DECLARE_MEMBER - }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class ServerIsBusy final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.ServerIsBusy) */ { - public: - inline ServerIsBusy() : ServerIsBusy(nullptr) {} - ~ServerIsBusy() override; - template - explicit PROTOBUF_CONSTEXPR ServerIsBusy(::google::protobuf::internal::ConstantInitialized); - - inline ServerIsBusy(const ServerIsBusy& from) - : ServerIsBusy(nullptr, from) {} - ServerIsBusy(ServerIsBusy&& from) noexcept - : ServerIsBusy() { - *this = ::std::move(from); - } - - inline ServerIsBusy& operator=(const ServerIsBusy& from) { - CopyFrom(from); - return *this; - } - inline ServerIsBusy& operator=(ServerIsBusy&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const ServerIsBusy& default_instance() { - return *internal_default_instance(); - } - static inline const ServerIsBusy* internal_default_instance() { - return reinterpret_cast( - &_ServerIsBusy_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(ServerIsBusy& a, ServerIsBusy& b) { - a.Swap(&b); - } - inline void Swap(ServerIsBusy* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(ServerIsBusy* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - ServerIsBusy* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const ServerIsBusy& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const ServerIsBusy& from) { - ServerIsBusy::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(ServerIsBusy* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.ServerIsBusy"; - } - protected: - explicit ServerIsBusy(::google::protobuf::Arena* arena); - ServerIsBusy(::google::protobuf::Arena* arena, const ServerIsBusy& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kReasonFieldNumber = 1, - kBackoffMsFieldNumber = 2, - }; - // string reason = 1; - void clear_reason() ; - const std::string& reason() const; - template - void set_reason(Arg_&& arg, Args_... args); - std::string* mutable_reason(); - PROTOBUF_NODISCARD std::string* release_reason(); - void set_allocated_reason(std::string* value); - - private: - const std::string& _internal_reason() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_reason( - const std::string& value); - std::string* _internal_mutable_reason(); - - public: - // uint64 backoff_ms = 2; - void clear_backoff_ms() ; - ::uint64_t backoff_ms() const; - void set_backoff_ms(::uint64_t value); - - private: - ::uint64_t _internal_backoff_ms() const; - void _internal_set_backoff_ms(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:errorpb.ServerIsBusy) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 35, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::ArenaStringPtr reason_; - ::uint64_t backoff_ms_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class RegionNotFound final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.RegionNotFound) */ { - public: - inline RegionNotFound() : RegionNotFound(nullptr) {} - ~RegionNotFound() override; - template - explicit PROTOBUF_CONSTEXPR RegionNotFound(::google::protobuf::internal::ConstantInitialized); - - inline RegionNotFound(const RegionNotFound& from) - : RegionNotFound(nullptr, from) {} - RegionNotFound(RegionNotFound&& from) noexcept - : RegionNotFound() { - *this = ::std::move(from); - } - - inline RegionNotFound& operator=(const RegionNotFound& from) { - CopyFrom(from); - return *this; - } - inline RegionNotFound& operator=(RegionNotFound&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RegionNotFound& default_instance() { - return *internal_default_instance(); - } - static inline const RegionNotFound* internal_default_instance() { - return reinterpret_cast( - &_RegionNotFound_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(RegionNotFound& a, RegionNotFound& b) { - a.Swap(&b); - } - inline void Swap(RegionNotFound* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RegionNotFound* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RegionNotFound* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RegionNotFound& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RegionNotFound& from) { - RegionNotFound::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RegionNotFound* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.RegionNotFound"; - } - protected: - explicit RegionNotFound(::google::protobuf::Arena* arena); - RegionNotFound(::google::protobuf::Arena* arena, const RegionNotFound& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRegionIdFieldNumber = 1, - }; - // uint64 region_id = 1; - void clear_region_id() ; - ::uint64_t region_id() const; - void set_region_id(::uint64_t value); - - private: - ::uint64_t _internal_region_id() const; - void _internal_set_region_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:errorpb.RegionNotFound) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 0, 1, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::uint64_t region_id_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class RaftEntryTooLarge final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.RaftEntryTooLarge) */ { - public: - inline RaftEntryTooLarge() : RaftEntryTooLarge(nullptr) {} - ~RaftEntryTooLarge() override; - template - explicit PROTOBUF_CONSTEXPR RaftEntryTooLarge(::google::protobuf::internal::ConstantInitialized); - - inline RaftEntryTooLarge(const RaftEntryTooLarge& from) - : RaftEntryTooLarge(nullptr, from) {} - RaftEntryTooLarge(RaftEntryTooLarge&& from) noexcept - : RaftEntryTooLarge() { - *this = ::std::move(from); - } - - inline RaftEntryTooLarge& operator=(const RaftEntryTooLarge& from) { - CopyFrom(from); - return *this; - } - inline RaftEntryTooLarge& operator=(RaftEntryTooLarge&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RaftEntryTooLarge& default_instance() { - return *internal_default_instance(); - } - static inline const RaftEntryTooLarge* internal_default_instance() { - return reinterpret_cast( - &_RaftEntryTooLarge_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(RaftEntryTooLarge& a, RaftEntryTooLarge& b) { - a.Swap(&b); - } - inline void Swap(RaftEntryTooLarge* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RaftEntryTooLarge* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RaftEntryTooLarge* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RaftEntryTooLarge& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RaftEntryTooLarge& from) { - RaftEntryTooLarge::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RaftEntryTooLarge* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.RaftEntryTooLarge"; - } - protected: - explicit RaftEntryTooLarge(::google::protobuf::Arena* arena); - RaftEntryTooLarge(::google::protobuf::Arena* arena, const RaftEntryTooLarge& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRegionIdFieldNumber = 1, - kEntrySizeFieldNumber = 2, - }; - // uint64 region_id = 1; - void clear_region_id() ; - ::uint64_t region_id() const; - void set_region_id(::uint64_t value); - - private: - ::uint64_t _internal_region_id() const; - void _internal_set_region_id(::uint64_t value); - - public: - // uint64 entry_size = 2; - void clear_entry_size() ; - ::uint64_t entry_size() const; - void set_entry_size(::uint64_t value); - - private: - ::uint64_t _internal_entry_size() const; - void _internal_set_entry_size(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:errorpb.RaftEntryTooLarge) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::uint64_t region_id_; - ::uint64_t entry_size_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class KeyNotInRegion final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.KeyNotInRegion) */ { - public: - inline KeyNotInRegion() : KeyNotInRegion(nullptr) {} - ~KeyNotInRegion() override; - template - explicit PROTOBUF_CONSTEXPR KeyNotInRegion(::google::protobuf::internal::ConstantInitialized); - - inline KeyNotInRegion(const KeyNotInRegion& from) - : KeyNotInRegion(nullptr, from) {} - KeyNotInRegion(KeyNotInRegion&& from) noexcept - : KeyNotInRegion() { - *this = ::std::move(from); - } - - inline KeyNotInRegion& operator=(const KeyNotInRegion& from) { - CopyFrom(from); - return *this; - } - inline KeyNotInRegion& operator=(KeyNotInRegion&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const KeyNotInRegion& default_instance() { - return *internal_default_instance(); - } - static inline const KeyNotInRegion* internal_default_instance() { - return reinterpret_cast( - &_KeyNotInRegion_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(KeyNotInRegion& a, KeyNotInRegion& b) { - a.Swap(&b); - } - inline void Swap(KeyNotInRegion* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(KeyNotInRegion* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - KeyNotInRegion* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const KeyNotInRegion& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const KeyNotInRegion& from) { - KeyNotInRegion::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(KeyNotInRegion* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.KeyNotInRegion"; - } - protected: - explicit KeyNotInRegion(::google::protobuf::Arena* arena); - KeyNotInRegion(::google::protobuf::Arena* arena, const KeyNotInRegion& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 1, - kStartKeyFieldNumber = 3, - kEndKeyFieldNumber = 4, - kRegionIdFieldNumber = 2, - }; - // bytes key = 1; - void clear_key() ; - const std::string& key() const; - template - void set_key(Arg_&& arg, Args_... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* value); - - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key( - const std::string& value); - std::string* _internal_mutable_key(); - - public: - // bytes start_key = 3; - void clear_start_key() ; - const std::string& start_key() const; - template - void set_start_key(Arg_&& arg, Args_... args); - std::string* mutable_start_key(); - PROTOBUF_NODISCARD std::string* release_start_key(); - void set_allocated_start_key(std::string* value); - - private: - const std::string& _internal_start_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_start_key( - const std::string& value); - std::string* _internal_mutable_start_key(); - - public: - // bytes end_key = 4; - void clear_end_key() ; - const std::string& end_key() const; - template - void set_end_key(Arg_&& arg, Args_... args); - std::string* mutable_end_key(); - PROTOBUF_NODISCARD std::string* release_end_key(); - void set_allocated_end_key(std::string* value); - - private: - const std::string& _internal_end_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_end_key( - const std::string& value); - std::string* _internal_mutable_end_key(); - - public: - // uint64 region_id = 2; - void clear_region_id() ; - ::uint64_t region_id() const; - void set_region_id(::uint64_t value); - - private: - ::uint64_t _internal_region_id() const; - void _internal_set_region_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:errorpb.KeyNotInRegion) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 4, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::ArenaStringPtr key_; - ::google::protobuf::internal::ArenaStringPtr start_key_; - ::google::protobuf::internal::ArenaStringPtr end_key_; - ::uint64_t region_id_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class NotLeader final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.NotLeader) */ { - public: - inline NotLeader() : NotLeader(nullptr) {} - ~NotLeader() override; - template - explicit PROTOBUF_CONSTEXPR NotLeader(::google::protobuf::internal::ConstantInitialized); - - inline NotLeader(const NotLeader& from) - : NotLeader(nullptr, from) {} - NotLeader(NotLeader&& from) noexcept - : NotLeader() { - *this = ::std::move(from); - } - - inline NotLeader& operator=(const NotLeader& from) { - CopyFrom(from); - return *this; - } - inline NotLeader& operator=(NotLeader&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const NotLeader& default_instance() { - return *internal_default_instance(); - } - static inline const NotLeader* internal_default_instance() { - return reinterpret_cast( - &_NotLeader_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(NotLeader& a, NotLeader& b) { - a.Swap(&b); - } - inline void Swap(NotLeader* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(NotLeader* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - NotLeader* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const NotLeader& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const NotLeader& from) { - NotLeader::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(NotLeader* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.NotLeader"; - } - protected: - explicit NotLeader(::google::protobuf::Arena* arena); - NotLeader(::google::protobuf::Arena* arena, const NotLeader& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kLeaderFieldNumber = 2, - kRegionIdFieldNumber = 1, - }; - // .metapb.Peer leader = 2; - bool has_leader() const; - void clear_leader() ; - const ::metapb::Peer& leader() const; - PROTOBUF_NODISCARD ::metapb::Peer* release_leader(); - ::metapb::Peer* mutable_leader(); - void set_allocated_leader(::metapb::Peer* value); - void unsafe_arena_set_allocated_leader(::metapb::Peer* value); - ::metapb::Peer* unsafe_arena_release_leader(); - - private: - const ::metapb::Peer& _internal_leader() const; - ::metapb::Peer* _internal_mutable_leader(); - - public: - // uint64 region_id = 1; - void clear_region_id() ; - ::uint64_t region_id() const; - void set_region_id(::uint64_t value); - - private: - ::uint64_t _internal_region_id() const; - void _internal_set_region_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:errorpb.NotLeader) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::metapb::Peer* leader_; - ::uint64_t region_id_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class EpochNotMatch final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.EpochNotMatch) */ { - public: - inline EpochNotMatch() : EpochNotMatch(nullptr) {} - ~EpochNotMatch() override; - template - explicit PROTOBUF_CONSTEXPR EpochNotMatch(::google::protobuf::internal::ConstantInitialized); - - inline EpochNotMatch(const EpochNotMatch& from) - : EpochNotMatch(nullptr, from) {} - EpochNotMatch(EpochNotMatch&& from) noexcept - : EpochNotMatch() { - *this = ::std::move(from); - } - - inline EpochNotMatch& operator=(const EpochNotMatch& from) { - CopyFrom(from); - return *this; - } - inline EpochNotMatch& operator=(EpochNotMatch&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const EpochNotMatch& default_instance() { - return *internal_default_instance(); - } - static inline const EpochNotMatch* internal_default_instance() { - return reinterpret_cast( - &_EpochNotMatch_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(EpochNotMatch& a, EpochNotMatch& b) { - a.Swap(&b); - } - inline void Swap(EpochNotMatch* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(EpochNotMatch* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - EpochNotMatch* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const EpochNotMatch& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const EpochNotMatch& from) { - EpochNotMatch::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(EpochNotMatch* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.EpochNotMatch"; - } - protected: - explicit EpochNotMatch(::google::protobuf::Arena* arena); - EpochNotMatch(::google::protobuf::Arena* arena, const EpochNotMatch& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCurrentRegionsFieldNumber = 1, - }; - // repeated .metapb.Region current_regions = 1; - int current_regions_size() const; - private: - int _internal_current_regions_size() const; - - public: - void clear_current_regions() ; - ::metapb::Region* mutable_current_regions(int index); - ::google::protobuf::RepeatedPtrField< ::metapb::Region >* - mutable_current_regions(); - private: - const ::google::protobuf::RepeatedPtrField<::metapb::Region>& _internal_current_regions() const; - ::google::protobuf::RepeatedPtrField<::metapb::Region>* _internal_mutable_current_regions(); - public: - const ::metapb::Region& current_regions(int index) const; - ::metapb::Region* add_current_regions(); - const ::google::protobuf::RepeatedPtrField< ::metapb::Region >& - current_regions() const; - // @@protoc_insertion_point(class_scope:errorpb.EpochNotMatch) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 0, 1, 1, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::RepeatedPtrField< ::metapb::Region > current_regions_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -};// ------------------------------------------------------------------- - -class Error final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:errorpb.Error) */ { - public: - inline Error() : Error(nullptr) {} - ~Error() override; - template - explicit PROTOBUF_CONSTEXPR Error(::google::protobuf::internal::ConstantInitialized); - - inline Error(const Error& from) - : Error(nullptr, from) {} - Error(Error&& from) noexcept - : Error() { - *this = ::std::move(from); - } - - inline Error& operator=(const Error& from) { - CopyFrom(from); - return *this; - } - inline Error& operator=(Error&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Error& default_instance() { - return *internal_default_instance(); - } - static inline const Error* internal_default_instance() { - return reinterpret_cast( - &_Error_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(Error& a, Error& b) { - a.Swap(&b); - } - inline void Swap(Error* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Error* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Error* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Error& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Error& from) { - Error::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Error* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "errorpb.Error"; - } - protected: - explicit Error(::google::protobuf::Arena* arena); - Error(::google::protobuf::Arena* arena, const Error& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kMessageFieldNumber = 1, - kNotLeaderFieldNumber = 2, - kRegionNotFoundFieldNumber = 3, - kKeyNotInRegionFieldNumber = 4, - kEpochNotMatchFieldNumber = 5, - kServerIsBusyFieldNumber = 6, - kStaleCommandFieldNumber = 7, - kStoreNotMatchFieldNumber = 8, - kRaftEntryTooLargeFieldNumber = 9, - }; - // string message = 1; - void clear_message() ; - const std::string& message() const; - template - void set_message(Arg_&& arg, Args_... args); - std::string* mutable_message(); - PROTOBUF_NODISCARD std::string* release_message(); - void set_allocated_message(std::string* value); - - private: - const std::string& _internal_message() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_message( - const std::string& value); - std::string* _internal_mutable_message(); - - public: - // .errorpb.NotLeader not_leader = 2; - bool has_not_leader() const; - void clear_not_leader() ; - const ::errorpb::NotLeader& not_leader() const; - PROTOBUF_NODISCARD ::errorpb::NotLeader* release_not_leader(); - ::errorpb::NotLeader* mutable_not_leader(); - void set_allocated_not_leader(::errorpb::NotLeader* value); - void unsafe_arena_set_allocated_not_leader(::errorpb::NotLeader* value); - ::errorpb::NotLeader* unsafe_arena_release_not_leader(); - - private: - const ::errorpb::NotLeader& _internal_not_leader() const; - ::errorpb::NotLeader* _internal_mutable_not_leader(); - - public: - // .errorpb.RegionNotFound region_not_found = 3; - bool has_region_not_found() const; - void clear_region_not_found() ; - const ::errorpb::RegionNotFound& region_not_found() const; - PROTOBUF_NODISCARD ::errorpb::RegionNotFound* release_region_not_found(); - ::errorpb::RegionNotFound* mutable_region_not_found(); - void set_allocated_region_not_found(::errorpb::RegionNotFound* value); - void unsafe_arena_set_allocated_region_not_found(::errorpb::RegionNotFound* value); - ::errorpb::RegionNotFound* unsafe_arena_release_region_not_found(); - - private: - const ::errorpb::RegionNotFound& _internal_region_not_found() const; - ::errorpb::RegionNotFound* _internal_mutable_region_not_found(); - - public: - // .errorpb.KeyNotInRegion key_not_in_region = 4; - bool has_key_not_in_region() const; - void clear_key_not_in_region() ; - const ::errorpb::KeyNotInRegion& key_not_in_region() const; - PROTOBUF_NODISCARD ::errorpb::KeyNotInRegion* release_key_not_in_region(); - ::errorpb::KeyNotInRegion* mutable_key_not_in_region(); - void set_allocated_key_not_in_region(::errorpb::KeyNotInRegion* value); - void unsafe_arena_set_allocated_key_not_in_region(::errorpb::KeyNotInRegion* value); - ::errorpb::KeyNotInRegion* unsafe_arena_release_key_not_in_region(); - - private: - const ::errorpb::KeyNotInRegion& _internal_key_not_in_region() const; - ::errorpb::KeyNotInRegion* _internal_mutable_key_not_in_region(); - - public: - // .errorpb.EpochNotMatch epoch_not_match = 5; - bool has_epoch_not_match() const; - void clear_epoch_not_match() ; - const ::errorpb::EpochNotMatch& epoch_not_match() const; - PROTOBUF_NODISCARD ::errorpb::EpochNotMatch* release_epoch_not_match(); - ::errorpb::EpochNotMatch* mutable_epoch_not_match(); - void set_allocated_epoch_not_match(::errorpb::EpochNotMatch* value); - void unsafe_arena_set_allocated_epoch_not_match(::errorpb::EpochNotMatch* value); - ::errorpb::EpochNotMatch* unsafe_arena_release_epoch_not_match(); - - private: - const ::errorpb::EpochNotMatch& _internal_epoch_not_match() const; - ::errorpb::EpochNotMatch* _internal_mutable_epoch_not_match(); - - public: - // .errorpb.ServerIsBusy server_is_busy = 6; - bool has_server_is_busy() const; - void clear_server_is_busy() ; - const ::errorpb::ServerIsBusy& server_is_busy() const; - PROTOBUF_NODISCARD ::errorpb::ServerIsBusy* release_server_is_busy(); - ::errorpb::ServerIsBusy* mutable_server_is_busy(); - void set_allocated_server_is_busy(::errorpb::ServerIsBusy* value); - void unsafe_arena_set_allocated_server_is_busy(::errorpb::ServerIsBusy* value); - ::errorpb::ServerIsBusy* unsafe_arena_release_server_is_busy(); - - private: - const ::errorpb::ServerIsBusy& _internal_server_is_busy() const; - ::errorpb::ServerIsBusy* _internal_mutable_server_is_busy(); - - public: - // .errorpb.StaleCommand stale_command = 7; - bool has_stale_command() const; - void clear_stale_command() ; - const ::errorpb::StaleCommand& stale_command() const; - PROTOBUF_NODISCARD ::errorpb::StaleCommand* release_stale_command(); - ::errorpb::StaleCommand* mutable_stale_command(); - void set_allocated_stale_command(::errorpb::StaleCommand* value); - void unsafe_arena_set_allocated_stale_command(::errorpb::StaleCommand* value); - ::errorpb::StaleCommand* unsafe_arena_release_stale_command(); - - private: - const ::errorpb::StaleCommand& _internal_stale_command() const; - ::errorpb::StaleCommand* _internal_mutable_stale_command(); - - public: - // .errorpb.StoreNotMatch store_not_match = 8; - bool has_store_not_match() const; - void clear_store_not_match() ; - const ::errorpb::StoreNotMatch& store_not_match() const; - PROTOBUF_NODISCARD ::errorpb::StoreNotMatch* release_store_not_match(); - ::errorpb::StoreNotMatch* mutable_store_not_match(); - void set_allocated_store_not_match(::errorpb::StoreNotMatch* value); - void unsafe_arena_set_allocated_store_not_match(::errorpb::StoreNotMatch* value); - ::errorpb::StoreNotMatch* unsafe_arena_release_store_not_match(); - - private: - const ::errorpb::StoreNotMatch& _internal_store_not_match() const; - ::errorpb::StoreNotMatch* _internal_mutable_store_not_match(); - - public: - // .errorpb.RaftEntryTooLarge raft_entry_too_large = 9; - bool has_raft_entry_too_large() const; - void clear_raft_entry_too_large() ; - const ::errorpb::RaftEntryTooLarge& raft_entry_too_large() const; - PROTOBUF_NODISCARD ::errorpb::RaftEntryTooLarge* release_raft_entry_too_large(); - ::errorpb::RaftEntryTooLarge* mutable_raft_entry_too_large(); - void set_allocated_raft_entry_too_large(::errorpb::RaftEntryTooLarge* value); - void unsafe_arena_set_allocated_raft_entry_too_large(::errorpb::RaftEntryTooLarge* value); - ::errorpb::RaftEntryTooLarge* unsafe_arena_release_raft_entry_too_large(); - - private: - const ::errorpb::RaftEntryTooLarge& _internal_raft_entry_too_large() const; - ::errorpb::RaftEntryTooLarge* _internal_mutable_raft_entry_too_large(); - - public: - // @@protoc_insertion_point(class_scope:errorpb.Error) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 4, 9, 8, - 37, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr message_; - ::errorpb::NotLeader* not_leader_; - ::errorpb::RegionNotFound* region_not_found_; - ::errorpb::KeyNotInRegion* key_not_in_region_; - ::errorpb::EpochNotMatch* epoch_not_match_; - ::errorpb::ServerIsBusy* server_is_busy_; - ::errorpb::StaleCommand* stale_command_; - ::errorpb::StoreNotMatch* store_not_match_; - ::errorpb::RaftEntryTooLarge* raft_entry_too_large_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_errorpb_2eproto; -}; - -// =================================================================== - - - - -// =================================================================== - - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// NotLeader - -// uint64 region_id = 1; -inline void NotLeader::clear_region_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.region_id_ = ::uint64_t{0u}; -} -inline ::uint64_t NotLeader::region_id() const { - // @@protoc_insertion_point(field_get:errorpb.NotLeader.region_id) - return _internal_region_id(); -} -inline void NotLeader::set_region_id(::uint64_t value) { - _internal_set_region_id(value); - // @@protoc_insertion_point(field_set:errorpb.NotLeader.region_id) -} -inline ::uint64_t NotLeader::_internal_region_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.region_id_; -} -inline void NotLeader::_internal_set_region_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.region_id_ = value; -} - -// .metapb.Peer leader = 2; -inline bool NotLeader::has_leader() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.leader_ != nullptr); - return value; -} -inline const ::metapb::Peer& NotLeader::_internal_leader() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::metapb::Peer* p = _impl_.leader_; - return p != nullptr ? *p : reinterpret_cast(::metapb::_Peer_default_instance_); -} -inline const ::metapb::Peer& NotLeader::leader() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.NotLeader.leader) - return _internal_leader(); -} -inline void NotLeader::unsafe_arena_set_allocated_leader(::metapb::Peer* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.leader_); - } - _impl_.leader_ = reinterpret_cast<::metapb::Peer*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.NotLeader.leader) -} -inline ::metapb::Peer* NotLeader::release_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::metapb::Peer* released = _impl_.leader_; - _impl_.leader_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::metapb::Peer* NotLeader::unsafe_arena_release_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.NotLeader.leader) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::metapb::Peer* temp = _impl_.leader_; - _impl_.leader_ = nullptr; - return temp; -} -inline ::metapb::Peer* NotLeader::_internal_mutable_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.leader_ == nullptr) { - auto* p = CreateMaybeMessage<::metapb::Peer>(GetArena()); - _impl_.leader_ = reinterpret_cast<::metapb::Peer*>(p); - } - return _impl_.leader_; -} -inline ::metapb::Peer* NotLeader::mutable_leader() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::metapb::Peer* _msg = _internal_mutable_leader(); - // @@protoc_insertion_point(field_mutable:errorpb.NotLeader.leader) - return _msg; -} -inline void NotLeader::set_allocated_leader(::metapb::Peer* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.leader_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.leader_ = reinterpret_cast<::metapb::Peer*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.NotLeader.leader) -} - -// ------------------------------------------------------------------- - -// StoreNotMatch - -// uint64 request_store_id = 1; -inline void StoreNotMatch::clear_request_store_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.request_store_id_ = ::uint64_t{0u}; -} -inline ::uint64_t StoreNotMatch::request_store_id() const { - // @@protoc_insertion_point(field_get:errorpb.StoreNotMatch.request_store_id) - return _internal_request_store_id(); -} -inline void StoreNotMatch::set_request_store_id(::uint64_t value) { - _internal_set_request_store_id(value); - // @@protoc_insertion_point(field_set:errorpb.StoreNotMatch.request_store_id) -} -inline ::uint64_t StoreNotMatch::_internal_request_store_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.request_store_id_; -} -inline void StoreNotMatch::_internal_set_request_store_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.request_store_id_ = value; -} - -// uint64 actual_store_id = 2; -inline void StoreNotMatch::clear_actual_store_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.actual_store_id_ = ::uint64_t{0u}; -} -inline ::uint64_t StoreNotMatch::actual_store_id() const { - // @@protoc_insertion_point(field_get:errorpb.StoreNotMatch.actual_store_id) - return _internal_actual_store_id(); -} -inline void StoreNotMatch::set_actual_store_id(::uint64_t value) { - _internal_set_actual_store_id(value); - // @@protoc_insertion_point(field_set:errorpb.StoreNotMatch.actual_store_id) -} -inline ::uint64_t StoreNotMatch::_internal_actual_store_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.actual_store_id_; -} -inline void StoreNotMatch::_internal_set_actual_store_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.actual_store_id_ = value; -} - -// ------------------------------------------------------------------- - -// RegionNotFound - -// uint64 region_id = 1; -inline void RegionNotFound::clear_region_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.region_id_ = ::uint64_t{0u}; -} -inline ::uint64_t RegionNotFound::region_id() const { - // @@protoc_insertion_point(field_get:errorpb.RegionNotFound.region_id) - return _internal_region_id(); -} -inline void RegionNotFound::set_region_id(::uint64_t value) { - _internal_set_region_id(value); - // @@protoc_insertion_point(field_set:errorpb.RegionNotFound.region_id) -} -inline ::uint64_t RegionNotFound::_internal_region_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.region_id_; -} -inline void RegionNotFound::_internal_set_region_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.region_id_ = value; -} - -// ------------------------------------------------------------------- - -// KeyNotInRegion - -// bytes key = 1; -inline void KeyNotInRegion::clear_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.ClearToEmpty(); -} -inline const std::string& KeyNotInRegion::key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.KeyNotInRegion.key) - return _internal_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void KeyNotInRegion::set_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:errorpb.KeyNotInRegion.key) -} -inline std::string* KeyNotInRegion::mutable_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:errorpb.KeyNotInRegion.key) - return _s; -} -inline const std::string& KeyNotInRegion::_internal_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_.Get(); -} -inline void KeyNotInRegion::_internal_set_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(value, GetArena()); -} -inline std::string* KeyNotInRegion::_internal_mutable_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.key_.Mutable( GetArena()); -} -inline std::string* KeyNotInRegion::release_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.KeyNotInRegion.key) - return _impl_.key_.Release(); -} -inline void KeyNotInRegion::set_allocated_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:errorpb.KeyNotInRegion.key) -} - -// uint64 region_id = 2; -inline void KeyNotInRegion::clear_region_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.region_id_ = ::uint64_t{0u}; -} -inline ::uint64_t KeyNotInRegion::region_id() const { - // @@protoc_insertion_point(field_get:errorpb.KeyNotInRegion.region_id) - return _internal_region_id(); -} -inline void KeyNotInRegion::set_region_id(::uint64_t value) { - _internal_set_region_id(value); - // @@protoc_insertion_point(field_set:errorpb.KeyNotInRegion.region_id) -} -inline ::uint64_t KeyNotInRegion::_internal_region_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.region_id_; -} -inline void KeyNotInRegion::_internal_set_region_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.region_id_ = value; -} - -// bytes start_key = 3; -inline void KeyNotInRegion::clear_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.ClearToEmpty(); -} -inline const std::string& KeyNotInRegion::start_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.KeyNotInRegion.start_key) - return _internal_start_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void KeyNotInRegion::set_start_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:errorpb.KeyNotInRegion.start_key) -} -inline std::string* KeyNotInRegion::mutable_start_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_start_key(); - // @@protoc_insertion_point(field_mutable:errorpb.KeyNotInRegion.start_key) - return _s; -} -inline const std::string& KeyNotInRegion::_internal_start_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.start_key_.Get(); -} -inline void KeyNotInRegion::_internal_set_start_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.Set(value, GetArena()); -} -inline std::string* KeyNotInRegion::_internal_mutable_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.start_key_.Mutable( GetArena()); -} -inline std::string* KeyNotInRegion::release_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.KeyNotInRegion.start_key) - return _impl_.start_key_.Release(); -} -inline void KeyNotInRegion::set_allocated_start_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.start_key_.IsDefault()) { - _impl_.start_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:errorpb.KeyNotInRegion.start_key) -} - -// bytes end_key = 4; -inline void KeyNotInRegion::clear_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.ClearToEmpty(); -} -inline const std::string& KeyNotInRegion::end_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.KeyNotInRegion.end_key) - return _internal_end_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void KeyNotInRegion::set_end_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:errorpb.KeyNotInRegion.end_key) -} -inline std::string* KeyNotInRegion::mutable_end_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_end_key(); - // @@protoc_insertion_point(field_mutable:errorpb.KeyNotInRegion.end_key) - return _s; -} -inline const std::string& KeyNotInRegion::_internal_end_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.end_key_.Get(); -} -inline void KeyNotInRegion::_internal_set_end_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.Set(value, GetArena()); -} -inline std::string* KeyNotInRegion::_internal_mutable_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.end_key_.Mutable( GetArena()); -} -inline std::string* KeyNotInRegion::release_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.KeyNotInRegion.end_key) - return _impl_.end_key_.Release(); -} -inline void KeyNotInRegion::set_allocated_end_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.end_key_.IsDefault()) { - _impl_.end_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:errorpb.KeyNotInRegion.end_key) -} - -// ------------------------------------------------------------------- - -// EpochNotMatch - -// repeated .metapb.Region current_regions = 1; -inline int EpochNotMatch::_internal_current_regions_size() const { - return _internal_current_regions().size(); -} -inline int EpochNotMatch::current_regions_size() const { - return _internal_current_regions_size(); -} -inline ::metapb::Region* EpochNotMatch::mutable_current_regions(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:errorpb.EpochNotMatch.current_regions) - return _internal_mutable_current_regions()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Region>* EpochNotMatch::mutable_current_regions() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:errorpb.EpochNotMatch.current_regions) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_current_regions(); -} -inline const ::metapb::Region& EpochNotMatch::current_regions(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.EpochNotMatch.current_regions) - return _internal_current_regions().Get(index); -} -inline ::metapb::Region* EpochNotMatch::add_current_regions() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::metapb::Region* _add = _internal_mutable_current_regions()->Add(); - // @@protoc_insertion_point(field_add:errorpb.EpochNotMatch.current_regions) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Region>& EpochNotMatch::current_regions() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:errorpb.EpochNotMatch.current_regions) - return _internal_current_regions(); -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Region>& -EpochNotMatch::_internal_current_regions() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.current_regions_; -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Region>* -EpochNotMatch::_internal_mutable_current_regions() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.current_regions_; -} - -// ------------------------------------------------------------------- - -// ServerIsBusy - -// string reason = 1; -inline void ServerIsBusy::clear_reason() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.reason_.ClearToEmpty(); -} -inline const std::string& ServerIsBusy::reason() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.ServerIsBusy.reason) - return _internal_reason(); -} -template -inline PROTOBUF_ALWAYS_INLINE void ServerIsBusy::set_reason(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.reason_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:errorpb.ServerIsBusy.reason) -} -inline std::string* ServerIsBusy::mutable_reason() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_reason(); - // @@protoc_insertion_point(field_mutable:errorpb.ServerIsBusy.reason) - return _s; -} -inline const std::string& ServerIsBusy::_internal_reason() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.reason_.Get(); -} -inline void ServerIsBusy::_internal_set_reason(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.reason_.Set(value, GetArena()); -} -inline std::string* ServerIsBusy::_internal_mutable_reason() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.reason_.Mutable( GetArena()); -} -inline std::string* ServerIsBusy::release_reason() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.ServerIsBusy.reason) - return _impl_.reason_.Release(); -} -inline void ServerIsBusy::set_allocated_reason(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.reason_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.reason_.IsDefault()) { - _impl_.reason_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:errorpb.ServerIsBusy.reason) -} - -// uint64 backoff_ms = 2; -inline void ServerIsBusy::clear_backoff_ms() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.backoff_ms_ = ::uint64_t{0u}; -} -inline ::uint64_t ServerIsBusy::backoff_ms() const { - // @@protoc_insertion_point(field_get:errorpb.ServerIsBusy.backoff_ms) - return _internal_backoff_ms(); -} -inline void ServerIsBusy::set_backoff_ms(::uint64_t value) { - _internal_set_backoff_ms(value); - // @@protoc_insertion_point(field_set:errorpb.ServerIsBusy.backoff_ms) -} -inline ::uint64_t ServerIsBusy::_internal_backoff_ms() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.backoff_ms_; -} -inline void ServerIsBusy::_internal_set_backoff_ms(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.backoff_ms_ = value; -} - -// ------------------------------------------------------------------- - -// StaleCommand - -// ------------------------------------------------------------------- - -// RaftEntryTooLarge - -// uint64 region_id = 1; -inline void RaftEntryTooLarge::clear_region_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.region_id_ = ::uint64_t{0u}; -} -inline ::uint64_t RaftEntryTooLarge::region_id() const { - // @@protoc_insertion_point(field_get:errorpb.RaftEntryTooLarge.region_id) - return _internal_region_id(); -} -inline void RaftEntryTooLarge::set_region_id(::uint64_t value) { - _internal_set_region_id(value); - // @@protoc_insertion_point(field_set:errorpb.RaftEntryTooLarge.region_id) -} -inline ::uint64_t RaftEntryTooLarge::_internal_region_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.region_id_; -} -inline void RaftEntryTooLarge::_internal_set_region_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.region_id_ = value; -} - -// uint64 entry_size = 2; -inline void RaftEntryTooLarge::clear_entry_size() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.entry_size_ = ::uint64_t{0u}; -} -inline ::uint64_t RaftEntryTooLarge::entry_size() const { - // @@protoc_insertion_point(field_get:errorpb.RaftEntryTooLarge.entry_size) - return _internal_entry_size(); -} -inline void RaftEntryTooLarge::set_entry_size(::uint64_t value) { - _internal_set_entry_size(value); - // @@protoc_insertion_point(field_set:errorpb.RaftEntryTooLarge.entry_size) -} -inline ::uint64_t RaftEntryTooLarge::_internal_entry_size() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.entry_size_; -} -inline void RaftEntryTooLarge::_internal_set_entry_size(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.entry_size_ = value; -} - -// ------------------------------------------------------------------- - -// Error - -// string message = 1; -inline void Error::clear_message() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.message_.ClearToEmpty(); -} -inline const std::string& Error::message() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.message) - return _internal_message(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Error::set_message(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.message_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:errorpb.Error.message) -} -inline std::string* Error::mutable_message() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_message(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.message) - return _s; -} -inline const std::string& Error::_internal_message() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.message_.Get(); -} -inline void Error::_internal_set_message(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.message_.Set(value, GetArena()); -} -inline std::string* Error::_internal_mutable_message() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.message_.Mutable( GetArena()); -} -inline std::string* Error::release_message() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.message) - return _impl_.message_.Release(); -} -inline void Error::set_allocated_message(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.message_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.message_.IsDefault()) { - _impl_.message_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.message) -} - -// .errorpb.NotLeader not_leader = 2; -inline bool Error::has_not_leader() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.not_leader_ != nullptr); - return value; -} -inline void Error::clear_not_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.not_leader_ != nullptr) _impl_.not_leader_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::errorpb::NotLeader& Error::_internal_not_leader() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::NotLeader* p = _impl_.not_leader_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_NotLeader_default_instance_); -} -inline const ::errorpb::NotLeader& Error::not_leader() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.not_leader) - return _internal_not_leader(); -} -inline void Error::unsafe_arena_set_allocated_not_leader(::errorpb::NotLeader* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.not_leader_); - } - _impl_.not_leader_ = reinterpret_cast<::errorpb::NotLeader*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.not_leader) -} -inline ::errorpb::NotLeader* Error::release_not_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::NotLeader* released = _impl_.not_leader_; - _impl_.not_leader_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::NotLeader* Error::unsafe_arena_release_not_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.not_leader) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::NotLeader* temp = _impl_.not_leader_; - _impl_.not_leader_ = nullptr; - return temp; -} -inline ::errorpb::NotLeader* Error::_internal_mutable_not_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.not_leader_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::NotLeader>(GetArena()); - _impl_.not_leader_ = reinterpret_cast<::errorpb::NotLeader*>(p); - } - return _impl_.not_leader_; -} -inline ::errorpb::NotLeader* Error::mutable_not_leader() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::NotLeader* _msg = _internal_mutable_not_leader(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.not_leader) - return _msg; -} -inline void Error::set_allocated_not_leader(::errorpb::NotLeader* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::NotLeader*>(_impl_.not_leader_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::NotLeader*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.not_leader_ = reinterpret_cast<::errorpb::NotLeader*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.not_leader) -} - -// .errorpb.RegionNotFound region_not_found = 3; -inline bool Error::has_region_not_found() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_not_found_ != nullptr); - return value; -} -inline void Error::clear_region_not_found() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_not_found_ != nullptr) _impl_.region_not_found_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const ::errorpb::RegionNotFound& Error::_internal_region_not_found() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::RegionNotFound* p = _impl_.region_not_found_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_RegionNotFound_default_instance_); -} -inline const ::errorpb::RegionNotFound& Error::region_not_found() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.region_not_found) - return _internal_region_not_found(); -} -inline void Error::unsafe_arena_set_allocated_region_not_found(::errorpb::RegionNotFound* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_not_found_); - } - _impl_.region_not_found_ = reinterpret_cast<::errorpb::RegionNotFound*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.region_not_found) -} -inline ::errorpb::RegionNotFound* Error::release_region_not_found() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000002u; - ::errorpb::RegionNotFound* released = _impl_.region_not_found_; - _impl_.region_not_found_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::RegionNotFound* Error::unsafe_arena_release_region_not_found() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.region_not_found) - - _impl_._has_bits_[0] &= ~0x00000002u; - ::errorpb::RegionNotFound* temp = _impl_.region_not_found_; - _impl_.region_not_found_ = nullptr; - return temp; -} -inline ::errorpb::RegionNotFound* Error::_internal_mutable_region_not_found() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.region_not_found_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::RegionNotFound>(GetArena()); - _impl_.region_not_found_ = reinterpret_cast<::errorpb::RegionNotFound*>(p); - } - return _impl_.region_not_found_; -} -inline ::errorpb::RegionNotFound* Error::mutable_region_not_found() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::RegionNotFound* _msg = _internal_mutable_region_not_found(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.region_not_found) - return _msg; -} -inline void Error::set_allocated_region_not_found(::errorpb::RegionNotFound* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::RegionNotFound*>(_impl_.region_not_found_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::RegionNotFound*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - - _impl_.region_not_found_ = reinterpret_cast<::errorpb::RegionNotFound*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.region_not_found) -} - -// .errorpb.KeyNotInRegion key_not_in_region = 4; -inline bool Error::has_key_not_in_region() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.key_not_in_region_ != nullptr); - return value; -} -inline void Error::clear_key_not_in_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.key_not_in_region_ != nullptr) _impl_.key_not_in_region_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline const ::errorpb::KeyNotInRegion& Error::_internal_key_not_in_region() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::KeyNotInRegion* p = _impl_.key_not_in_region_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_KeyNotInRegion_default_instance_); -} -inline const ::errorpb::KeyNotInRegion& Error::key_not_in_region() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.key_not_in_region) - return _internal_key_not_in_region(); -} -inline void Error::unsafe_arena_set_allocated_key_not_in_region(::errorpb::KeyNotInRegion* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.key_not_in_region_); - } - _impl_.key_not_in_region_ = reinterpret_cast<::errorpb::KeyNotInRegion*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.key_not_in_region) -} -inline ::errorpb::KeyNotInRegion* Error::release_key_not_in_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000004u; - ::errorpb::KeyNotInRegion* released = _impl_.key_not_in_region_; - _impl_.key_not_in_region_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::KeyNotInRegion* Error::unsafe_arena_release_key_not_in_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.key_not_in_region) - - _impl_._has_bits_[0] &= ~0x00000004u; - ::errorpb::KeyNotInRegion* temp = _impl_.key_not_in_region_; - _impl_.key_not_in_region_ = nullptr; - return temp; -} -inline ::errorpb::KeyNotInRegion* Error::_internal_mutable_key_not_in_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.key_not_in_region_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::KeyNotInRegion>(GetArena()); - _impl_.key_not_in_region_ = reinterpret_cast<::errorpb::KeyNotInRegion*>(p); - } - return _impl_.key_not_in_region_; -} -inline ::errorpb::KeyNotInRegion* Error::mutable_key_not_in_region() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::KeyNotInRegion* _msg = _internal_mutable_key_not_in_region(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.key_not_in_region) - return _msg; -} -inline void Error::set_allocated_key_not_in_region(::errorpb::KeyNotInRegion* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::KeyNotInRegion*>(_impl_.key_not_in_region_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::KeyNotInRegion*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - - _impl_.key_not_in_region_ = reinterpret_cast<::errorpb::KeyNotInRegion*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.key_not_in_region) -} - -// .errorpb.EpochNotMatch epoch_not_match = 5; -inline bool Error::has_epoch_not_match() const { - bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0; - PROTOBUF_ASSUME(!value || _impl_.epoch_not_match_ != nullptr); - return value; -} -inline void Error::clear_epoch_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.epoch_not_match_ != nullptr) _impl_.epoch_not_match_->Clear(); - _impl_._has_bits_[0] &= ~0x00000008u; -} -inline const ::errorpb::EpochNotMatch& Error::_internal_epoch_not_match() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::EpochNotMatch* p = _impl_.epoch_not_match_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_EpochNotMatch_default_instance_); -} -inline const ::errorpb::EpochNotMatch& Error::epoch_not_match() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.epoch_not_match) - return _internal_epoch_not_match(); -} -inline void Error::unsafe_arena_set_allocated_epoch_not_match(::errorpb::EpochNotMatch* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.epoch_not_match_); - } - _impl_.epoch_not_match_ = reinterpret_cast<::errorpb::EpochNotMatch*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000008u; - } else { - _impl_._has_bits_[0] &= ~0x00000008u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.epoch_not_match) -} -inline ::errorpb::EpochNotMatch* Error::release_epoch_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000008u; - ::errorpb::EpochNotMatch* released = _impl_.epoch_not_match_; - _impl_.epoch_not_match_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::EpochNotMatch* Error::unsafe_arena_release_epoch_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.epoch_not_match) - - _impl_._has_bits_[0] &= ~0x00000008u; - ::errorpb::EpochNotMatch* temp = _impl_.epoch_not_match_; - _impl_.epoch_not_match_ = nullptr; - return temp; -} -inline ::errorpb::EpochNotMatch* Error::_internal_mutable_epoch_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000008u; - if (_impl_.epoch_not_match_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::EpochNotMatch>(GetArena()); - _impl_.epoch_not_match_ = reinterpret_cast<::errorpb::EpochNotMatch*>(p); - } - return _impl_.epoch_not_match_; -} -inline ::errorpb::EpochNotMatch* Error::mutable_epoch_not_match() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::EpochNotMatch* _msg = _internal_mutable_epoch_not_match(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.epoch_not_match) - return _msg; -} -inline void Error::set_allocated_epoch_not_match(::errorpb::EpochNotMatch* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::EpochNotMatch*>(_impl_.epoch_not_match_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::EpochNotMatch*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000008u; - } else { - _impl_._has_bits_[0] &= ~0x00000008u; - } - - _impl_.epoch_not_match_ = reinterpret_cast<::errorpb::EpochNotMatch*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.epoch_not_match) -} - -// .errorpb.ServerIsBusy server_is_busy = 6; -inline bool Error::has_server_is_busy() const { - bool value = (_impl_._has_bits_[0] & 0x00000010u) != 0; - PROTOBUF_ASSUME(!value || _impl_.server_is_busy_ != nullptr); - return value; -} -inline void Error::clear_server_is_busy() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.server_is_busy_ != nullptr) _impl_.server_is_busy_->Clear(); - _impl_._has_bits_[0] &= ~0x00000010u; -} -inline const ::errorpb::ServerIsBusy& Error::_internal_server_is_busy() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::ServerIsBusy* p = _impl_.server_is_busy_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_ServerIsBusy_default_instance_); -} -inline const ::errorpb::ServerIsBusy& Error::server_is_busy() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.server_is_busy) - return _internal_server_is_busy(); -} -inline void Error::unsafe_arena_set_allocated_server_is_busy(::errorpb::ServerIsBusy* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.server_is_busy_); - } - _impl_.server_is_busy_ = reinterpret_cast<::errorpb::ServerIsBusy*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000010u; - } else { - _impl_._has_bits_[0] &= ~0x00000010u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.server_is_busy) -} -inline ::errorpb::ServerIsBusy* Error::release_server_is_busy() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000010u; - ::errorpb::ServerIsBusy* released = _impl_.server_is_busy_; - _impl_.server_is_busy_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::ServerIsBusy* Error::unsafe_arena_release_server_is_busy() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.server_is_busy) - - _impl_._has_bits_[0] &= ~0x00000010u; - ::errorpb::ServerIsBusy* temp = _impl_.server_is_busy_; - _impl_.server_is_busy_ = nullptr; - return temp; -} -inline ::errorpb::ServerIsBusy* Error::_internal_mutable_server_is_busy() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000010u; - if (_impl_.server_is_busy_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::ServerIsBusy>(GetArena()); - _impl_.server_is_busy_ = reinterpret_cast<::errorpb::ServerIsBusy*>(p); - } - return _impl_.server_is_busy_; -} -inline ::errorpb::ServerIsBusy* Error::mutable_server_is_busy() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::ServerIsBusy* _msg = _internal_mutable_server_is_busy(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.server_is_busy) - return _msg; -} -inline void Error::set_allocated_server_is_busy(::errorpb::ServerIsBusy* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::ServerIsBusy*>(_impl_.server_is_busy_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::ServerIsBusy*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000010u; - } else { - _impl_._has_bits_[0] &= ~0x00000010u; - } - - _impl_.server_is_busy_ = reinterpret_cast<::errorpb::ServerIsBusy*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.server_is_busy) -} - -// .errorpb.StaleCommand stale_command = 7; -inline bool Error::has_stale_command() const { - bool value = (_impl_._has_bits_[0] & 0x00000020u) != 0; - PROTOBUF_ASSUME(!value || _impl_.stale_command_ != nullptr); - return value; -} -inline void Error::clear_stale_command() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.stale_command_ != nullptr) _impl_.stale_command_->Clear(); - _impl_._has_bits_[0] &= ~0x00000020u; -} -inline const ::errorpb::StaleCommand& Error::_internal_stale_command() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::StaleCommand* p = _impl_.stale_command_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_StaleCommand_default_instance_); -} -inline const ::errorpb::StaleCommand& Error::stale_command() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.stale_command) - return _internal_stale_command(); -} -inline void Error::unsafe_arena_set_allocated_stale_command(::errorpb::StaleCommand* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.stale_command_); - } - _impl_.stale_command_ = reinterpret_cast<::errorpb::StaleCommand*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000020u; - } else { - _impl_._has_bits_[0] &= ~0x00000020u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.stale_command) -} -inline ::errorpb::StaleCommand* Error::release_stale_command() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000020u; - ::errorpb::StaleCommand* released = _impl_.stale_command_; - _impl_.stale_command_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::StaleCommand* Error::unsafe_arena_release_stale_command() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.stale_command) - - _impl_._has_bits_[0] &= ~0x00000020u; - ::errorpb::StaleCommand* temp = _impl_.stale_command_; - _impl_.stale_command_ = nullptr; - return temp; -} -inline ::errorpb::StaleCommand* Error::_internal_mutable_stale_command() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000020u; - if (_impl_.stale_command_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::StaleCommand>(GetArena()); - _impl_.stale_command_ = reinterpret_cast<::errorpb::StaleCommand*>(p); - } - return _impl_.stale_command_; -} -inline ::errorpb::StaleCommand* Error::mutable_stale_command() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::StaleCommand* _msg = _internal_mutable_stale_command(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.stale_command) - return _msg; -} -inline void Error::set_allocated_stale_command(::errorpb::StaleCommand* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::StaleCommand*>(_impl_.stale_command_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::StaleCommand*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000020u; - } else { - _impl_._has_bits_[0] &= ~0x00000020u; - } - - _impl_.stale_command_ = reinterpret_cast<::errorpb::StaleCommand*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.stale_command) -} - -// .errorpb.StoreNotMatch store_not_match = 8; -inline bool Error::has_store_not_match() const { - bool value = (_impl_._has_bits_[0] & 0x00000040u) != 0; - PROTOBUF_ASSUME(!value || _impl_.store_not_match_ != nullptr); - return value; -} -inline void Error::clear_store_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.store_not_match_ != nullptr) _impl_.store_not_match_->Clear(); - _impl_._has_bits_[0] &= ~0x00000040u; -} -inline const ::errorpb::StoreNotMatch& Error::_internal_store_not_match() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::StoreNotMatch* p = _impl_.store_not_match_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_StoreNotMatch_default_instance_); -} -inline const ::errorpb::StoreNotMatch& Error::store_not_match() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.store_not_match) - return _internal_store_not_match(); -} -inline void Error::unsafe_arena_set_allocated_store_not_match(::errorpb::StoreNotMatch* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.store_not_match_); - } - _impl_.store_not_match_ = reinterpret_cast<::errorpb::StoreNotMatch*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.store_not_match) -} -inline ::errorpb::StoreNotMatch* Error::release_store_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000040u; - ::errorpb::StoreNotMatch* released = _impl_.store_not_match_; - _impl_.store_not_match_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::StoreNotMatch* Error::unsafe_arena_release_store_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.store_not_match) - - _impl_._has_bits_[0] &= ~0x00000040u; - ::errorpb::StoreNotMatch* temp = _impl_.store_not_match_; - _impl_.store_not_match_ = nullptr; - return temp; -} -inline ::errorpb::StoreNotMatch* Error::_internal_mutable_store_not_match() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000040u; - if (_impl_.store_not_match_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::StoreNotMatch>(GetArena()); - _impl_.store_not_match_ = reinterpret_cast<::errorpb::StoreNotMatch*>(p); - } - return _impl_.store_not_match_; -} -inline ::errorpb::StoreNotMatch* Error::mutable_store_not_match() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::StoreNotMatch* _msg = _internal_mutable_store_not_match(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.store_not_match) - return _msg; -} -inline void Error::set_allocated_store_not_match(::errorpb::StoreNotMatch* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::StoreNotMatch*>(_impl_.store_not_match_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::StoreNotMatch*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000040u; - } else { - _impl_._has_bits_[0] &= ~0x00000040u; - } - - _impl_.store_not_match_ = reinterpret_cast<::errorpb::StoreNotMatch*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.store_not_match) -} - -// .errorpb.RaftEntryTooLarge raft_entry_too_large = 9; -inline bool Error::has_raft_entry_too_large() const { - bool value = (_impl_._has_bits_[0] & 0x00000080u) != 0; - PROTOBUF_ASSUME(!value || _impl_.raft_entry_too_large_ != nullptr); - return value; -} -inline void Error::clear_raft_entry_too_large() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.raft_entry_too_large_ != nullptr) _impl_.raft_entry_too_large_->Clear(); - _impl_._has_bits_[0] &= ~0x00000080u; -} -inline const ::errorpb::RaftEntryTooLarge& Error::_internal_raft_entry_too_large() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::RaftEntryTooLarge* p = _impl_.raft_entry_too_large_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_RaftEntryTooLarge_default_instance_); -} -inline const ::errorpb::RaftEntryTooLarge& Error::raft_entry_too_large() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:errorpb.Error.raft_entry_too_large) - return _internal_raft_entry_too_large(); -} -inline void Error::unsafe_arena_set_allocated_raft_entry_too_large(::errorpb::RaftEntryTooLarge* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.raft_entry_too_large_); - } - _impl_.raft_entry_too_large_ = reinterpret_cast<::errorpb::RaftEntryTooLarge*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000080u; - } else { - _impl_._has_bits_[0] &= ~0x00000080u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:errorpb.Error.raft_entry_too_large) -} -inline ::errorpb::RaftEntryTooLarge* Error::release_raft_entry_too_large() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000080u; - ::errorpb::RaftEntryTooLarge* released = _impl_.raft_entry_too_large_; - _impl_.raft_entry_too_large_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::RaftEntryTooLarge* Error::unsafe_arena_release_raft_entry_too_large() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:errorpb.Error.raft_entry_too_large) - - _impl_._has_bits_[0] &= ~0x00000080u; - ::errorpb::RaftEntryTooLarge* temp = _impl_.raft_entry_too_large_; - _impl_.raft_entry_too_large_ = nullptr; - return temp; -} -inline ::errorpb::RaftEntryTooLarge* Error::_internal_mutable_raft_entry_too_large() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000080u; - if (_impl_.raft_entry_too_large_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::RaftEntryTooLarge>(GetArena()); - _impl_.raft_entry_too_large_ = reinterpret_cast<::errorpb::RaftEntryTooLarge*>(p); - } - return _impl_.raft_entry_too_large_; -} -inline ::errorpb::RaftEntryTooLarge* Error::mutable_raft_entry_too_large() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::RaftEntryTooLarge* _msg = _internal_mutable_raft_entry_too_large(); - // @@protoc_insertion_point(field_mutable:errorpb.Error.raft_entry_too_large) - return _msg; -} -inline void Error::set_allocated_raft_entry_too_large(::errorpb::RaftEntryTooLarge* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::errorpb::RaftEntryTooLarge*>(_impl_.raft_entry_too_large_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::errorpb::RaftEntryTooLarge*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000080u; - } else { - _impl_._has_bits_[0] &= ~0x00000080u; - } - - _impl_.raft_entry_too_large_ = reinterpret_cast<::errorpb::RaftEntryTooLarge*>(value); - // @@protoc_insertion_point(field_set_allocated:errorpb.Error.raft_entry_too_large) -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) -} // namespace errorpb - - -// @@protoc_insertion_point(global_scope) - -#include "google/protobuf/port_undef.inc" - -#endif // GOOGLE_PROTOBUF_INCLUDED_errorpb_2eproto_2epb_2eh diff --git a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.cc b/ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.cc deleted file mode 100644 index 6ff20a05f..000000000 --- a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: kvrpcpb.proto - -#include "kvrpcpb.pb.h" -#include "kvrpcpb.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace kvrpcpb { - -} // namespace kvrpcpb - diff --git a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.h b/ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.h deleted file mode 100644 index 3a3b3a3bb..000000000 --- a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.grpc.pb.h +++ /dev/null @@ -1,37 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: kvrpcpb.proto -// Original file comments: -// Extracted from https://github.com/pingcap/kvproto -// Minimal definitions for SPANN TiKV integration - KV RPC messages. -// -#ifndef GRPC_kvrpcpb_2eproto__INCLUDED -#define GRPC_kvrpcpb_2eproto__INCLUDED - -#include "kvrpcpb.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace kvrpcpb { - -} // namespace kvrpcpb - - -#endif // GRPC_kvrpcpb_2eproto__INCLUDED diff --git a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.cc b/ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.cc deleted file mode 100644 index a98037543..000000000 --- a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.cc +++ /dev/null @@ -1,8115 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: kvrpcpb.proto - -#include "kvrpcpb.pb.h" - -#include -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/extension_set.h" -#include "google/protobuf/wire_format_lite.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/reflection_ops.h" -#include "google/protobuf/wire_format.h" -#include "google/protobuf/generated_message_tctable_impl.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" -PROTOBUF_PRAGMA_INIT_SEG -namespace _pb = ::google::protobuf; -namespace _pbi = ::google::protobuf::internal; -namespace _fl = ::google::protobuf::internal::field_layout; -namespace kvrpcpb { - -inline constexpr KeyRange::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : start_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - end_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR KeyRange::KeyRange(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct KeyRangeDefaultTypeInternal { - PROTOBUF_CONSTEXPR KeyRangeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~KeyRangeDefaultTypeInternal() {} - union { - KeyRange _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KeyRangeDefaultTypeInternal _KeyRange_default_instance_; - -inline constexpr Context::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - resolved_locks_{}, - _resolved_locks_cached_byte_size_{0}, - resource_group_name_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - source_stmt_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_epoch_{nullptr}, - peer_{nullptr}, - region_id_{::uint64_t{0u}}, - term_{::uint64_t{0u}}, - priority_{static_cast< ::kvrpcpb::CommandPri >(0)}, - isolation_level_{static_cast< ::kvrpcpb::IsolationLevel >(0)}, - read_quorum_{false}, - not_fill_cache_{false}, - sync_log_{false}, - stale_read_{false}, - replica_read_{false}, - resource_group_tag_{::uint64_t{0u}}, - max_execution_duration_ms_{::uint64_t{0u}}, - request_source_{::uint64_t{0u}} {} - -template -PROTOBUF_CONSTEXPR Context::Context(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct ContextDefaultTypeInternal { - PROTOBUF_CONSTEXPR ContextDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~ContextDefaultTypeInternal() {} - union { - Context _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ContextDefaultTypeInternal _Context_default_instance_; - -inline constexpr RawScanRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - start_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - end_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr}, - limit_{0u}, - key_only_{false}, - reverse_{false} {} - -template -PROTOBUF_CONSTEXPR RawScanRequest::RawScanRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawScanRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawScanRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawScanRequestDefaultTypeInternal() {} - union { - RawScanRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawScanRequestDefaultTypeInternal _RawScanRequest_default_instance_; - -inline constexpr RawPutRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - value_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr}, - ttl_{::uint64_t{0u}}, - for_cas_{false} {} - -template -PROTOBUF_CONSTEXPR RawPutRequest::RawPutRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawPutRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawPutRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawPutRequestDefaultTypeInternal() {} - union { - RawPutRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawPutRequestDefaultTypeInternal _RawPutRequest_default_instance_; - -inline constexpr RawGetRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawGetRequest::RawGetRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawGetRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawGetRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawGetRequestDefaultTypeInternal() {} - union { - RawGetRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawGetRequestDefaultTypeInternal _RawGetRequest_default_instance_; - -inline constexpr RawDeleteRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr}, - for_cas_{false} {} - -template -PROTOBUF_CONSTEXPR RawDeleteRequest::RawDeleteRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawDeleteRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawDeleteRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawDeleteRequestDefaultTypeInternal() {} - union { - RawDeleteRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawDeleteRequestDefaultTypeInternal _RawDeleteRequest_default_instance_; - -inline constexpr RawDeleteRangeRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - start_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - end_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawDeleteRangeRequest::RawDeleteRangeRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawDeleteRangeRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawDeleteRangeRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawDeleteRangeRequestDefaultTypeInternal() {} - union { - RawDeleteRangeRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawDeleteRangeRequestDefaultTypeInternal _RawDeleteRangeRequest_default_instance_; - -inline constexpr RawCoprocessorRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - ranges_{}, - copr_name_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - copr_version_req_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - data_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawCoprocessorRequest::RawCoprocessorRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawCoprocessorRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawCoprocessorRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawCoprocessorRequestDefaultTypeInternal() {} - union { - RawCoprocessorRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawCoprocessorRequestDefaultTypeInternal _RawCoprocessorRequest_default_instance_; - -inline constexpr RawCASRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - value_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - previous_value_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr}, - ttl_{::uint64_t{0u}}, - previous_not_exist_{false}, - delete__{false} {} - -template -PROTOBUF_CONSTEXPR RawCASRequest::RawCASRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawCASRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawCASRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawCASRequestDefaultTypeInternal() {} - union { - RawCASRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawCASRequestDefaultTypeInternal _RawCASRequest_default_instance_; - -inline constexpr RawBatchGetRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - keys_{}, - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawBatchGetRequest::RawBatchGetRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawBatchGetRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawBatchGetRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawBatchGetRequestDefaultTypeInternal() {} - union { - RawBatchGetRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawBatchGetRequestDefaultTypeInternal _RawBatchGetRequest_default_instance_; - -inline constexpr RawBatchDeleteRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - keys_{}, - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawBatchDeleteRequest::RawBatchDeleteRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawBatchDeleteRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawBatchDeleteRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawBatchDeleteRequestDefaultTypeInternal() {} - union { - RawBatchDeleteRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawBatchDeleteRequestDefaultTypeInternal _RawBatchDeleteRequest_default_instance_; - -inline constexpr RawPutResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawPutResponse::RawPutResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawPutResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawPutResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawPutResponseDefaultTypeInternal() {} - union { - RawPutResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawPutResponseDefaultTypeInternal _RawPutResponse_default_instance_; - -inline constexpr RawGetResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - value_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr}, - not_found_{false} {} - -template -PROTOBUF_CONSTEXPR RawGetResponse::RawGetResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawGetResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawGetResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawGetResponseDefaultTypeInternal() {} - union { - RawGetResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawGetResponseDefaultTypeInternal _RawGetResponse_default_instance_; - -inline constexpr RawDeleteResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawDeleteResponse::RawDeleteResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawDeleteResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawDeleteResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawDeleteResponseDefaultTypeInternal() {} - union { - RawDeleteResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawDeleteResponseDefaultTypeInternal _RawDeleteResponse_default_instance_; - -inline constexpr RawDeleteRangeResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawDeleteRangeResponse::RawDeleteRangeResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawDeleteRangeResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawDeleteRangeResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawDeleteRangeResponseDefaultTypeInternal() {} - union { - RawDeleteRangeResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawDeleteRangeResponseDefaultTypeInternal _RawDeleteRangeResponse_default_instance_; - -inline constexpr RawCoprocessorResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - data_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawCoprocessorResponse::RawCoprocessorResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawCoprocessorResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawCoprocessorResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawCoprocessorResponseDefaultTypeInternal() {} - union { - RawCoprocessorResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawCoprocessorResponseDefaultTypeInternal _RawCoprocessorResponse_default_instance_; - -inline constexpr RawCASResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - previous_value_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr}, - succeed_{false}, - previous_not_exist_{false} {} - -template -PROTOBUF_CONSTEXPR RawCASResponse::RawCASResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawCASResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawCASResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawCASResponseDefaultTypeInternal() {} - union { - RawCASResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawCASResponseDefaultTypeInternal _RawCASResponse_default_instance_; - -inline constexpr RawBatchPutResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawBatchPutResponse::RawBatchPutResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawBatchPutResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawBatchPutResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawBatchPutResponseDefaultTypeInternal() {} - union { - RawBatchPutResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawBatchPutResponseDefaultTypeInternal _RawBatchPutResponse_default_instance_; - -inline constexpr RawBatchDeleteResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawBatchDeleteResponse::RawBatchDeleteResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawBatchDeleteResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawBatchDeleteResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawBatchDeleteResponseDefaultTypeInternal() {} - union { - RawBatchDeleteResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawBatchDeleteResponseDefaultTypeInternal _RawBatchDeleteResponse_default_instance_; - -inline constexpr KvPair::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - value_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR KvPair::KvPair(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct KvPairDefaultTypeInternal { - PROTOBUF_CONSTEXPR KvPairDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~KvPairDefaultTypeInternal() {} - union { - KvPair _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KvPairDefaultTypeInternal _KvPair_default_instance_; - -inline constexpr RawScanResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - kvs_{}, - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawScanResponse::RawScanResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawScanResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawScanResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawScanResponseDefaultTypeInternal() {} - union { - RawScanResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawScanResponseDefaultTypeInternal _RawScanResponse_default_instance_; - -inline constexpr RawBatchPutRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - pairs_{}, - cf_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - context_{nullptr}, - ttl_{::uint64_t{0u}}, - for_cas_{false} {} - -template -PROTOBUF_CONSTEXPR RawBatchPutRequest::RawBatchPutRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawBatchPutRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawBatchPutRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawBatchPutRequestDefaultTypeInternal() {} - union { - RawBatchPutRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawBatchPutRequestDefaultTypeInternal _RawBatchPutRequest_default_instance_; - -inline constexpr RawBatchGetResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - pairs_{}, - region_error_{nullptr} {} - -template -PROTOBUF_CONSTEXPR RawBatchGetResponse::RawBatchGetResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RawBatchGetResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR RawBatchGetResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RawBatchGetResponseDefaultTypeInternal() {} - union { - RawBatchGetResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RawBatchGetResponseDefaultTypeInternal _RawBatchGetResponse_default_instance_; -} // namespace kvrpcpb -static ::_pb::Metadata file_level_metadata_kvrpcpb_2eproto[23]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_kvrpcpb_2eproto[2]; -static constexpr const ::_pb::ServiceDescriptor** - file_level_service_descriptors_kvrpcpb_2eproto = nullptr; -const ::uint32_t TableStruct_kvrpcpb_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( - protodesc_cold) = { - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.region_id_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.region_epoch_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.peer_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.read_quorum_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.term_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.priority_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.isolation_level_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.not_fill_cache_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.sync_log_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.stale_read_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.resource_group_tag_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.replica_read_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.resolved_locks_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.max_execution_duration_ms_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.resource_group_name_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.source_stmt_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::Context, _impl_.request_source_), - ~0u, - 0, - 1, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KvPair, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KvPair, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KvPair, _impl_.error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KvPair, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KvPair, _impl_.value_), - 0, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetRequest, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetRequest, _impl_.cf_), - 0, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetResponse, _impl_.error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetResponse, _impl_.value_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawGetResponse, _impl_.not_found_), - 0, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetRequest, _impl_.keys_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetRequest, _impl_.cf_), - 0, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchGetResponse, _impl_.pairs_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _impl_.value_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _impl_.cf_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _impl_.ttl_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutRequest, _impl_.for_cas_), - 0, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawPutResponse, _impl_.error_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutRequest, _impl_.pairs_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutRequest, _impl_.cf_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutRequest, _impl_.ttl_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutRequest, _impl_.for_cas_), - 0, - ~0u, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchPutResponse, _impl_.error_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRequest, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRequest, _impl_.cf_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRequest, _impl_.for_cas_), - 0, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteResponse, _impl_.error_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteRequest, _impl_.keys_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteRequest, _impl_.cf_), - 0, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawBatchDeleteResponse, _impl_.error_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeRequest, _impl_.start_key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeRequest, _impl_.end_key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeRequest, _impl_.cf_), - 0, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawDeleteRangeResponse, _impl_.error_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.value_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.previous_not_exist_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.previous_value_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.cf_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.ttl_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASRequest, _impl_.delete__), - 0, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASResponse, _impl_.error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASResponse, _impl_.succeed_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASResponse, _impl_.previous_not_exist_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCASResponse, _impl_.previous_value_), - 0, - ~0u, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_.start_key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_.limit_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_.key_only_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_.cf_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_.reverse_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanRequest, _impl_.end_key_), - 0, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawScanResponse, _impl_.kvs_), - 0, - ~0u, - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KeyRange, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KeyRange, _impl_.start_key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::KeyRange, _impl_.end_key_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorRequest, _impl_.context_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorRequest, _impl_.copr_name_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorRequest, _impl_.copr_version_req_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorRequest, _impl_.ranges_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorRequest, _impl_.data_), - 0, - ~0u, - ~0u, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorResponse, _impl_.region_error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorResponse, _impl_.error_), - PROTOBUF_FIELD_OFFSET(::kvrpcpb::RawCoprocessorResponse, _impl_.data_), - 0, - ~0u, - ~0u, -}; - -static const ::_pbi::MigrationSchema - schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, 25, -1, sizeof(::kvrpcpb::Context)}, - {42, 53, -1, sizeof(::kvrpcpb::KvPair)}, - {56, 67, -1, sizeof(::kvrpcpb::RawGetRequest)}, - {70, 82, -1, sizeof(::kvrpcpb::RawGetResponse)}, - {86, 97, -1, sizeof(::kvrpcpb::RawBatchGetRequest)}, - {100, 110, -1, sizeof(::kvrpcpb::RawBatchGetResponse)}, - {112, 126, -1, sizeof(::kvrpcpb::RawPutRequest)}, - {132, 142, -1, sizeof(::kvrpcpb::RawPutResponse)}, - {144, 157, -1, sizeof(::kvrpcpb::RawBatchPutRequest)}, - {162, 172, -1, sizeof(::kvrpcpb::RawBatchPutResponse)}, - {174, 186, -1, sizeof(::kvrpcpb::RawDeleteRequest)}, - {190, 200, -1, sizeof(::kvrpcpb::RawDeleteResponse)}, - {202, 213, -1, sizeof(::kvrpcpb::RawBatchDeleteRequest)}, - {216, 226, -1, sizeof(::kvrpcpb::RawBatchDeleteResponse)}, - {228, 240, -1, sizeof(::kvrpcpb::RawDeleteRangeRequest)}, - {244, 254, -1, sizeof(::kvrpcpb::RawDeleteRangeResponse)}, - {256, 272, -1, sizeof(::kvrpcpb::RawCASRequest)}, - {280, 293, -1, sizeof(::kvrpcpb::RawCASResponse)}, - {298, 313, -1, sizeof(::kvrpcpb::RawScanRequest)}, - {320, 330, -1, sizeof(::kvrpcpb::RawScanResponse)}, - {332, -1, -1, sizeof(::kvrpcpb::KeyRange)}, - {342, 355, -1, sizeof(::kvrpcpb::RawCoprocessorRequest)}, - {360, 371, -1, sizeof(::kvrpcpb::RawCoprocessorResponse)}, -}; - -static const ::_pb::Message* const file_default_instances[] = { - &::kvrpcpb::_Context_default_instance_._instance, - &::kvrpcpb::_KvPair_default_instance_._instance, - &::kvrpcpb::_RawGetRequest_default_instance_._instance, - &::kvrpcpb::_RawGetResponse_default_instance_._instance, - &::kvrpcpb::_RawBatchGetRequest_default_instance_._instance, - &::kvrpcpb::_RawBatchGetResponse_default_instance_._instance, - &::kvrpcpb::_RawPutRequest_default_instance_._instance, - &::kvrpcpb::_RawPutResponse_default_instance_._instance, - &::kvrpcpb::_RawBatchPutRequest_default_instance_._instance, - &::kvrpcpb::_RawBatchPutResponse_default_instance_._instance, - &::kvrpcpb::_RawDeleteRequest_default_instance_._instance, - &::kvrpcpb::_RawDeleteResponse_default_instance_._instance, - &::kvrpcpb::_RawBatchDeleteRequest_default_instance_._instance, - &::kvrpcpb::_RawBatchDeleteResponse_default_instance_._instance, - &::kvrpcpb::_RawDeleteRangeRequest_default_instance_._instance, - &::kvrpcpb::_RawDeleteRangeResponse_default_instance_._instance, - &::kvrpcpb::_RawCASRequest_default_instance_._instance, - &::kvrpcpb::_RawCASResponse_default_instance_._instance, - &::kvrpcpb::_RawScanRequest_default_instance_._instance, - &::kvrpcpb::_RawScanResponse_default_instance_._instance, - &::kvrpcpb::_KeyRange_default_instance_._instance, - &::kvrpcpb::_RawCoprocessorRequest_default_instance_._instance, - &::kvrpcpb::_RawCoprocessorResponse_default_instance_._instance, -}; -const char descriptor_table_protodef_kvrpcpb_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\rkvrpcpb.proto\022\007kvrpcpb\032\014metapb.proto\032\r" - "errorpb.proto\"\324\003\n\007Context\022\021\n\tregion_id\030\001" - " \001(\004\022)\n\014region_epoch\030\002 \001(\0132\023.metapb.Regi" - "onEpoch\022\032\n\004peer\030\003 \001(\0132\014.metapb.Peer\022\023\n\013r" - "ead_quorum\030\004 \001(\010\022\014\n\004term\030\005 \001(\004\022%\n\010priori" - "ty\030\006 \001(\0162\023.kvrpcpb.CommandPri\0220\n\017isolati" - "on_level\030\007 \001(\0162\027.kvrpcpb.IsolationLevel\022" - "\026\n\016not_fill_cache\030\010 \001(\010\022\020\n\010sync_log\030\t \001(" - "\010\022\022\n\nstale_read\030\n \001(\010\022\032\n\022resource_group_" - "tag\030\013 \001(\004\022\024\n\014replica_read\030\014 \001(\010\022\026\n\016resol" - "ved_locks\030\r \003(\004\022!\n\031max_execution_duratio" - "n_ms\030\016 \001(\004\022\033\n\023resource_group_name\030\017 \001(\t\022" - "\023\n\013source_stmt\030\020 \001(\014\022\026\n\016request_source\030\021" - " \001(\004\"C\n\006KvPair\022\035\n\005error\030\001 \001(\0132\016.errorpb." - "Error\022\013\n\003key\030\002 \001(\014\022\r\n\005value\030\003 \001(\014\"K\n\rRaw" - "GetRequest\022!\n\007context\030\001 \001(\0132\020.kvrpcpb.Co" - "ntext\022\013\n\003key\030\002 \001(\014\022\n\n\002cf\030\003 \001(\t\"g\n\016RawGet" - "Response\022$\n\014region_error\030\001 \001(\0132\016.errorpb" - ".Error\022\r\n\005error\030\002 \001(\t\022\r\n\005value\030\003 \001(\014\022\021\n\t" - "not_found\030\004 \001(\010\"Q\n\022RawBatchGetRequest\022!\n" - "\007context\030\001 \001(\0132\020.kvrpcpb.Context\022\014\n\004keys" - "\030\002 \003(\014\022\n\n\002cf\030\003 \001(\t\"[\n\023RawBatchGetRespons" - "e\022$\n\014region_error\030\001 \001(\0132\016.errorpb.Error\022" - "\036\n\005pairs\030\002 \003(\0132\017.kvrpcpb.KvPair\"x\n\rRawPu" - "tRequest\022!\n\007context\030\001 \001(\0132\020.kvrpcpb.Cont" - "ext\022\013\n\003key\030\002 \001(\014\022\r\n\005value\030\003 \001(\014\022\n\n\002cf\030\004 " - "\001(\t\022\013\n\003ttl\030\005 \001(\004\022\017\n\007for_cas\030\006 \001(\010\"E\n\016Raw" - "PutResponse\022$\n\014region_error\030\001 \001(\0132\016.erro" - "rpb.Error\022\r\n\005error\030\002 \001(\t\"\201\001\n\022RawBatchPut" - "Request\022!\n\007context\030\001 \001(\0132\020.kvrpcpb.Conte" - "xt\022\036\n\005pairs\030\002 \003(\0132\017.kvrpcpb.KvPair\022\n\n\002cf" - "\030\003 \001(\t\022\013\n\003ttl\030\004 \001(\004\022\017\n\007for_cas\030\005 \001(\010\"J\n\023" - "RawBatchPutResponse\022$\n\014region_error\030\001 \001(" - "\0132\016.errorpb.Error\022\r\n\005error\030\002 \001(\t\"_\n\020RawD" - "eleteRequest\022!\n\007context\030\001 \001(\0132\020.kvrpcpb." - "Context\022\013\n\003key\030\002 \001(\014\022\n\n\002cf\030\003 \001(\t\022\017\n\007for_" - "cas\030\004 \001(\010\"H\n\021RawDeleteResponse\022$\n\014region" - "_error\030\001 \001(\0132\016.errorpb.Error\022\r\n\005error\030\002 " - "\001(\t\"T\n\025RawBatchDeleteRequest\022!\n\007context\030" - "\001 \001(\0132\020.kvrpcpb.Context\022\014\n\004keys\030\002 \003(\014\022\n\n" - "\002cf\030\003 \001(\t\"M\n\026RawBatchDeleteResponse\022$\n\014r" - "egion_error\030\001 \001(\0132\016.errorpb.Error\022\r\n\005err" - "or\030\002 \001(\t\"j\n\025RawDeleteRangeRequest\022!\n\007con" - "text\030\001 \001(\0132\020.kvrpcpb.Context\022\021\n\tstart_ke" - "y\030\002 \001(\014\022\017\n\007end_key\030\003 \001(\014\022\n\n\002cf\030\004 \001(\t\"M\n\026" - "RawDeleteRangeResponse\022$\n\014region_error\030\001" - " \001(\0132\016.errorpb.Error\022\r\n\005error\030\002 \001(\t\"\253\001\n\r" - "RawCASRequest\022!\n\007context\030\001 \001(\0132\020.kvrpcpb" - ".Context\022\013\n\003key\030\002 \001(\014\022\r\n\005value\030\003 \001(\014\022\032\n\022" - "previous_not_exist\030\004 \001(\010\022\026\n\016previous_val" - "ue\030\005 \001(\014\022\n\n\002cf\030\006 \001(\t\022\013\n\003ttl\030\007 \001(\004\022\016\n\006del" - "ete\030\010 \001(\010\"\212\001\n\016RawCASResponse\022$\n\014region_e" - "rror\030\001 \001(\0132\016.errorpb.Error\022\r\n\005error\030\002 \001(" - "\t\022\017\n\007succeed\030\003 \001(\010\022\032\n\022previous_not_exist" - "\030\004 \001(\010\022\026\n\016previous_value\030\005 \001(\014\"\225\001\n\016RawSc" - "anRequest\022!\n\007context\030\001 \001(\0132\020.kvrpcpb.Con" - "text\022\021\n\tstart_key\030\002 \001(\014\022\r\n\005limit\030\003 \001(\r\022\020" - "\n\010key_only\030\004 \001(\010\022\n\n\002cf\030\005 \001(\t\022\017\n\007reverse\030" - "\006 \001(\010\022\017\n\007end_key\030\007 \001(\014\"U\n\017RawScanRespons" - "e\022$\n\014region_error\030\001 \001(\0132\016.errorpb.Error\022" - "\034\n\003kvs\030\002 \003(\0132\017.kvrpcpb.KvPair\".\n\010KeyRang" - "e\022\021\n\tstart_key\030\001 \001(\014\022\017\n\007end_key\030\002 \001(\014\"\230\001" - "\n\025RawCoprocessorRequest\022!\n\007context\030\001 \001(\013" - "2\020.kvrpcpb.Context\022\021\n\tcopr_name\030\002 \001(\t\022\030\n" - "\020copr_version_req\030\003 \001(\t\022!\n\006ranges\030\004 \003(\0132" - "\021.kvrpcpb.KeyRange\022\014\n\004data\030\005 \001(\014\"[\n\026RawC" - "oprocessorResponse\022$\n\014region_error\030\001 \001(\013" - "2\016.errorpb.Error\022\r\n\005error\030\002 \001(\t\022\014\n\004data\030" - "\003 \001(\014*+\n\nCommandPri\022\n\n\006Normal\020\000\022\007\n\003Low\020\001" - "\022\010\n\004High\020\002*/\n\016IsolationLevel\022\006\n\002SI\020\000\022\006\n\002" - "RC\020\001\022\r\n\tRCCheckTS\020\002B\022\n\020org.tikv.kvprotob" - "\006proto3" -}; -static const ::_pbi::DescriptorTable* const descriptor_table_kvrpcpb_2eproto_deps[2] = - { - &::descriptor_table_errorpb_2eproto, - &::descriptor_table_metapb_2eproto, -}; -static ::absl::once_flag descriptor_table_kvrpcpb_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_kvrpcpb_2eproto = { - false, - false, - 2847, - descriptor_table_protodef_kvrpcpb_2eproto, - "kvrpcpb.proto", - &descriptor_table_kvrpcpb_2eproto_once, - descriptor_table_kvrpcpb_2eproto_deps, - 2, - 23, - schemas, - file_default_instances, - TableStruct_kvrpcpb_2eproto::offsets, - file_level_metadata_kvrpcpb_2eproto, - file_level_enum_descriptors_kvrpcpb_2eproto, - file_level_service_descriptors_kvrpcpb_2eproto, -}; - -// This function exists to be marked as weak. -// It can significantly speed up compilation by breaking up LLVM's SCC -// in the .pb.cc translation units. Large translation units see a -// reduction of more than 35% of walltime for optimized builds. Without -// the weak attribute all the messages in the file, including all the -// vtables and everything they use become part of the same SCC through -// a cycle like: -// GetMetadata -> descriptor table -> default instances -> -// vtables -> GetMetadata -// By adding a weak function here we break the connection from the -// individual vtables back into the descriptor table. -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_kvrpcpb_2eproto_getter() { - return &descriptor_table_kvrpcpb_2eproto; -} -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 -static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_kvrpcpb_2eproto(&descriptor_table_kvrpcpb_2eproto); -namespace kvrpcpb { -const ::google::protobuf::EnumDescriptor* CommandPri_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_kvrpcpb_2eproto); - return file_level_enum_descriptors_kvrpcpb_2eproto[0]; -} -PROTOBUF_CONSTINIT const uint32_t CommandPri_internal_data_[] = { - 196608u, 0u, }; -bool CommandPri_IsValid(int value) { - return 0 <= value && value <= 2; -} -const ::google::protobuf::EnumDescriptor* IsolationLevel_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_kvrpcpb_2eproto); - return file_level_enum_descriptors_kvrpcpb_2eproto[1]; -} -PROTOBUF_CONSTINIT const uint32_t IsolationLevel_internal_data_[] = { - 196608u, 0u, }; -bool IsolationLevel_IsValid(int value) { - return 0 <= value && value <= 2; -} -// =================================================================== - -class Context::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(Context, _impl_._has_bits_); - static const ::metapb::RegionEpoch& region_epoch(const Context* msg); - static void set_has_region_epoch(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::metapb::Peer& peer(const Context* msg); - static void set_has_peer(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } -}; - -const ::metapb::RegionEpoch& Context::_Internal::region_epoch(const Context* msg) { - return *msg->_impl_.region_epoch_; -} -const ::metapb::Peer& Context::_Internal::peer(const Context* msg) { - return *msg->_impl_.peer_; -} -void Context::clear_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_epoch_ != nullptr) _impl_.region_epoch_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -void Context::clear_peer() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.peer_ != nullptr) _impl_.peer_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -Context::Context(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.Context) -} -inline PROTOBUF_NDEBUG_INLINE Context::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - resolved_locks_{visibility, arena, from.resolved_locks_}, - _resolved_locks_cached_byte_size_{0}, - resource_group_name_(arena, from.resource_group_name_), - source_stmt_(arena, from.source_stmt_) {} - -Context::Context( - ::google::protobuf::Arena* arena, - const Context& from) - : ::google::protobuf::Message(arena) { - Context* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_epoch_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::metapb::RegionEpoch>(arena, *from._impl_.region_epoch_) - : nullptr; - _impl_.peer_ = (cached_has_bits & 0x00000002u) - ? CreateMaybeMessage<::metapb::Peer>(arena, *from._impl_.peer_) - : nullptr; - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, region_id_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, region_id_), - offsetof(Impl_, request_source_) - - offsetof(Impl_, region_id_) + - sizeof(Impl_::request_source_)); - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.Context) -} -inline PROTOBUF_NDEBUG_INLINE Context::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - resolved_locks_{visibility, arena}, - _resolved_locks_cached_byte_size_{0}, - resource_group_name_(arena), - source_stmt_(arena) {} - -inline void Context::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, region_epoch_), - 0, - offsetof(Impl_, request_source_) - - offsetof(Impl_, region_epoch_) + - sizeof(Impl_::request_source_)); -} -Context::~Context() { - // @@protoc_insertion_point(destructor:kvrpcpb.Context) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Context::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.resource_group_name_.Destroy(); - _impl_.source_stmt_.Destroy(); - delete _impl_.region_epoch_; - delete _impl_.peer_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Context::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.Context) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.resolved_locks_.Clear(); - _impl_.resource_group_name_.ClearToEmpty(); - _impl_.source_stmt_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_epoch_ != nullptr); - _impl_.region_epoch_->Clear(); - } - if (cached_has_bits & 0x00000002u) { - ABSL_DCHECK(_impl_.peer_ != nullptr); - _impl_.peer_->Clear(); - } - } - ::memset(&_impl_.region_id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.request_source_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.request_source_)); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Context::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<5, 17, 2, 59, 2> Context::_table_ = { - { - PROTOBUF_FIELD_OFFSET(Context, _impl_._has_bits_), - 0, // no _extensions_ - 17, 248, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294836224, // skipmap - offsetof(decltype(_table_), field_entries), - 17, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_Context_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // uint64 region_id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Context, _impl_.region_id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.region_id_)}}, - // .metapb.RegionEpoch region_epoch = 2; - {::_pbi::TcParser::FastMtS1, - {18, 0, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.region_epoch_)}}, - // .metapb.Peer peer = 3; - {::_pbi::TcParser::FastMtS1, - {26, 1, 1, PROTOBUF_FIELD_OFFSET(Context, _impl_.peer_)}}, - // bool read_quorum = 4; - {::_pbi::TcParser::SingularVarintNoZag1(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.read_quorum_)}}, - // uint64 term = 5; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Context, _impl_.term_), 63>(), - {40, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.term_)}}, - // .kvrpcpb.CommandPri priority = 6; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Context, _impl_.priority_), 63>(), - {48, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.priority_)}}, - // .kvrpcpb.IsolationLevel isolation_level = 7; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Context, _impl_.isolation_level_), 63>(), - {56, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.isolation_level_)}}, - // bool not_fill_cache = 8; - {::_pbi::TcParser::SingularVarintNoZag1(), - {64, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.not_fill_cache_)}}, - // bool sync_log = 9; - {::_pbi::TcParser::SingularVarintNoZag1(), - {72, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.sync_log_)}}, - // bool stale_read = 10; - {::_pbi::TcParser::SingularVarintNoZag1(), - {80, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.stale_read_)}}, - // uint64 resource_group_tag = 11; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Context, _impl_.resource_group_tag_), 63>(), - {88, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.resource_group_tag_)}}, - // bool replica_read = 12; - {::_pbi::TcParser::SingularVarintNoZag1(), - {96, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.replica_read_)}}, - // repeated uint64 resolved_locks = 13; - {::_pbi::TcParser::FastV64P1, - {106, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.resolved_locks_)}}, - // uint64 max_execution_duration_ms = 14; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Context, _impl_.max_execution_duration_ms_), 63>(), - {112, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.max_execution_duration_ms_)}}, - // string resource_group_name = 15; - {::_pbi::TcParser::FastUS1, - {122, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.resource_group_name_)}}, - // bytes source_stmt = 16; - {::_pbi::TcParser::FastBS2, - {386, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.source_stmt_)}}, - // uint64 request_source = 17; - {::_pbi::TcParser::FastV64S2, - {392, 63, 0, PROTOBUF_FIELD_OFFSET(Context, _impl_.request_source_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 region_id = 1; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.region_id_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // .metapb.RegionEpoch region_epoch = 2; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.region_epoch_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .metapb.Peer peer = 3; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.peer_), _Internal::kHasBitsOffset + 1, 1, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bool read_quorum = 4; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.read_quorum_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // uint64 term = 5; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.term_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // .kvrpcpb.CommandPri priority = 6; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.priority_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // .kvrpcpb.IsolationLevel isolation_level = 7; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.isolation_level_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // bool not_fill_cache = 8; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.not_fill_cache_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bool sync_log = 9; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.sync_log_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bool stale_read = 10; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.stale_read_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // uint64 resource_group_tag = 11; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.resource_group_tag_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // bool replica_read = 12; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.replica_read_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // repeated uint64 resolved_locks = 13; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.resolved_locks_), -1, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kPackedUInt64)}, - // uint64 max_execution_duration_ms = 14; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.max_execution_duration_ms_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // string resource_group_name = 15; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.resource_group_name_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bytes source_stmt = 16; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.source_stmt_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // uint64 request_source = 17; - {PROTOBUF_FIELD_OFFSET(Context, _impl_.request_source_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, {{ - {::_pbi::TcParser::GetTable<::metapb::RegionEpoch>()}, - {::_pbi::TcParser::GetTable<::metapb::Peer>()}, - }}, {{ - "\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\23\0\0\0\0\0\0\0\0" - "kvrpcpb.Context" - "resource_group_name" - }}, -}; - -::uint8_t* Context::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.Context) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_region_id(), target); - } - - cached_has_bits = _impl_._has_bits_[0]; - // .metapb.RegionEpoch region_epoch = 2; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 2, _Internal::region_epoch(this), - _Internal::region_epoch(this).GetCachedSize(), target, stream); - } - - // .metapb.Peer peer = 3; - if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 3, _Internal::peer(this), - _Internal::peer(this).GetCachedSize(), target, stream); - } - - // bool read_quorum = 4; - if (this->_internal_read_quorum() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 4, this->_internal_read_quorum(), target); - } - - // uint64 term = 5; - if (this->_internal_term() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 5, this->_internal_term(), target); - } - - // .kvrpcpb.CommandPri priority = 6; - if (this->_internal_priority() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 6, this->_internal_priority(), target); - } - - // .kvrpcpb.IsolationLevel isolation_level = 7; - if (this->_internal_isolation_level() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 7, this->_internal_isolation_level(), target); - } - - // bool not_fill_cache = 8; - if (this->_internal_not_fill_cache() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 8, this->_internal_not_fill_cache(), target); - } - - // bool sync_log = 9; - if (this->_internal_sync_log() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 9, this->_internal_sync_log(), target); - } - - // bool stale_read = 10; - if (this->_internal_stale_read() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 10, this->_internal_stale_read(), target); - } - - // uint64 resource_group_tag = 11; - if (this->_internal_resource_group_tag() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 11, this->_internal_resource_group_tag(), target); - } - - // bool replica_read = 12; - if (this->_internal_replica_read() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 12, this->_internal_replica_read(), target); - } - - // repeated uint64 resolved_locks = 13; - { - int byte_size = _impl_._resolved_locks_cached_byte_size_.Get(); - if (byte_size > 0) { - target = stream->WriteUInt64Packed( - 13, _internal_resolved_locks(), byte_size, target); - } - } - - // uint64 max_execution_duration_ms = 14; - if (this->_internal_max_execution_duration_ms() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 14, this->_internal_max_execution_duration_ms(), target); - } - - // string resource_group_name = 15; - if (!this->_internal_resource_group_name().empty()) { - const std::string& _s = this->_internal_resource_group_name(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.Context.resource_group_name"); - target = stream->WriteStringMaybeAliased(15, _s, target); - } - - // bytes source_stmt = 16; - if (!this->_internal_source_stmt().empty()) { - const std::string& _s = this->_internal_source_stmt(); - target = stream->WriteBytesMaybeAliased(16, _s, target); - } - - // uint64 request_source = 17; - if (this->_internal_request_source() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 17, this->_internal_request_source(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.Context) - return target; -} - -::size_t Context::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.Context) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated uint64 resolved_locks = 13; - { - std::size_t data_size = ::_pbi::WireFormatLite::UInt64Size( - this->_internal_resolved_locks()) - ; - _impl_._resolved_locks_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size)); - std::size_t tag_size = data_size == 0 - ? 0 - : 1 + ::_pbi::WireFormatLite::Int32Size( - static_cast(data_size)) - ; - total_size += tag_size + data_size; - } - // string resource_group_name = 15; - if (!this->_internal_resource_group_name().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_resource_group_name()); - } - - // bytes source_stmt = 16; - if (!this->_internal_source_stmt().empty()) { - total_size += 2 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_source_stmt()); - } - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // .metapb.RegionEpoch region_epoch = 2; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_epoch_); - } - - // .metapb.Peer peer = 3; - if (cached_has_bits & 0x00000002u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.peer_); - } - - } - // uint64 region_id = 1; - if (this->_internal_region_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_region_id()); - } - - // uint64 term = 5; - if (this->_internal_term() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_term()); - } - - // .kvrpcpb.CommandPri priority = 6; - if (this->_internal_priority() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_priority()); - } - - // .kvrpcpb.IsolationLevel isolation_level = 7; - if (this->_internal_isolation_level() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_isolation_level()); - } - - // bool read_quorum = 4; - if (this->_internal_read_quorum() != 0) { - total_size += 2; - } - - // bool not_fill_cache = 8; - if (this->_internal_not_fill_cache() != 0) { - total_size += 2; - } - - // bool sync_log = 9; - if (this->_internal_sync_log() != 0) { - total_size += 2; - } - - // bool stale_read = 10; - if (this->_internal_stale_read() != 0) { - total_size += 2; - } - - // bool replica_read = 12; - if (this->_internal_replica_read() != 0) { - total_size += 2; - } - - // uint64 resource_group_tag = 11; - if (this->_internal_resource_group_tag() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_resource_group_tag()); - } - - // uint64 max_execution_duration_ms = 14; - if (this->_internal_max_execution_duration_ms() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_max_execution_duration_ms()); - } - - // uint64 request_source = 17; - if (this->_internal_request_source() != 0) { - total_size += 2 + ::_pbi::WireFormatLite::UInt64Size( - this->_internal_request_source()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Context::_class_data_ = { - Context::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Context::GetClassData() const { - return &_class_data_; -} - -void Context::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.Context) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_resolved_locks()->MergeFrom(from._internal_resolved_locks()); - if (!from._internal_resource_group_name().empty()) { - _this->_internal_set_resource_group_name(from._internal_resource_group_name()); - } - if (!from._internal_source_stmt().empty()) { - _this->_internal_set_source_stmt(from._internal_source_stmt()); - } - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_region_epoch()->::metapb::RegionEpoch::MergeFrom( - from._internal_region_epoch()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_peer()->::metapb::Peer::MergeFrom( - from._internal_peer()); - } - } - if (from._internal_region_id() != 0) { - _this->_internal_set_region_id(from._internal_region_id()); - } - if (from._internal_term() != 0) { - _this->_internal_set_term(from._internal_term()); - } - if (from._internal_priority() != 0) { - _this->_internal_set_priority(from._internal_priority()); - } - if (from._internal_isolation_level() != 0) { - _this->_internal_set_isolation_level(from._internal_isolation_level()); - } - if (from._internal_read_quorum() != 0) { - _this->_internal_set_read_quorum(from._internal_read_quorum()); - } - if (from._internal_not_fill_cache() != 0) { - _this->_internal_set_not_fill_cache(from._internal_not_fill_cache()); - } - if (from._internal_sync_log() != 0) { - _this->_internal_set_sync_log(from._internal_sync_log()); - } - if (from._internal_stale_read() != 0) { - _this->_internal_set_stale_read(from._internal_stale_read()); - } - if (from._internal_replica_read() != 0) { - _this->_internal_set_replica_read(from._internal_replica_read()); - } - if (from._internal_resource_group_tag() != 0) { - _this->_internal_set_resource_group_tag(from._internal_resource_group_tag()); - } - if (from._internal_max_execution_duration_ms() != 0) { - _this->_internal_set_max_execution_duration_ms(from._internal_max_execution_duration_ms()); - } - if (from._internal_request_source() != 0) { - _this->_internal_set_request_source(from._internal_request_source()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Context::CopyFrom(const Context& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.Context) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Context::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Context::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Context::InternalSwap(Context* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.resolved_locks_.InternalSwap(&other->_impl_.resolved_locks_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.resource_group_name_, &other->_impl_.resource_group_name_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.source_stmt_, &other->_impl_.source_stmt_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Context, _impl_.request_source_) - + sizeof(Context::_impl_.request_source_) - - PROTOBUF_FIELD_OFFSET(Context, _impl_.region_epoch_)>( - reinterpret_cast(&_impl_.region_epoch_), - reinterpret_cast(&other->_impl_.region_epoch_)); -} - -::google::protobuf::Metadata Context::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[0]); -} -// =================================================================== - -class KvPair::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(KvPair, _impl_._has_bits_); - static const ::errorpb::Error& error(const KvPair* msg); - static void set_has_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& KvPair::_Internal::error(const KvPair* msg) { - return *msg->_impl_.error_; -} -void KvPair::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.error_ != nullptr) _impl_.error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -KvPair::KvPair(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.KvPair) -} -inline PROTOBUF_NDEBUG_INLINE KvPair::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - key_(arena, from.key_), - value_(arena, from.value_) {} - -KvPair::KvPair( - ::google::protobuf::Arena* arena, - const KvPair& from) - : ::google::protobuf::Message(arena) { - KvPair* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.KvPair) -} -inline PROTOBUF_NDEBUG_INLINE KvPair::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - key_(arena), - value_(arena) {} - -inline void KvPair::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.error_ = {}; -} -KvPair::~KvPair() { - // @@protoc_insertion_point(destructor:kvrpcpb.KvPair) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void KvPair::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.key_.Destroy(); - _impl_.value_.Destroy(); - delete _impl_.error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void KvPair::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.KvPair) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.key_.ClearToEmpty(); - _impl_.value_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.error_ != nullptr); - _impl_.error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* KvPair::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 3, 1, 0, 2> KvPair::_table_ = { - { - PROTOBUF_FIELD_OFFSET(KvPair, _impl_._has_bits_), - 0, // no _extensions_ - 3, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap - offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_KvPair_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .errorpb.Error error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(KvPair, _impl_.error_)}}, - // bytes key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(KvPair, _impl_.key_)}}, - // bytes value = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(KvPair, _impl_.value_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error error = 1; - {PROTOBUF_FIELD_OFFSET(KvPair, _impl_.error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes key = 2; - {PROTOBUF_FIELD_OFFSET(KvPair, _impl_.key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes value = 3; - {PROTOBUF_FIELD_OFFSET(KvPair, _impl_.value_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - }}, -}; - -::uint8_t* KvPair::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.KvPair) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::error(this), - _Internal::error(this).GetCachedSize(), target, stream); - } - - // bytes key = 2; - if (!this->_internal_key().empty()) { - const std::string& _s = this->_internal_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - const std::string& _s = this->_internal_value(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.KvPair) - return target; -} - -::size_t KvPair::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.KvPair) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 2; - if (!this->_internal_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_key()); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_value()); - } - - // .errorpb.Error error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData KvPair::_class_data_ = { - KvPair::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* KvPair::GetClassData() const { - return &_class_data_; -} - -void KvPair::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.KvPair) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_key().empty()) { - _this->_internal_set_key(from._internal_key()); - } - if (!from._internal_value().empty()) { - _this->_internal_set_value(from._internal_value()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_error()->::errorpb::Error::MergeFrom( - from._internal_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void KvPair::CopyFrom(const KvPair& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.KvPair) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool KvPair::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* KvPair::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void KvPair::InternalSwap(KvPair* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.value_, &other->_impl_.value_, arena); - swap(_impl_.error_, other->_impl_.error_); -} - -::google::protobuf::Metadata KvPair::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[1]); -} -// =================================================================== - -class RawGetRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawGetRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawGetRequest::_Internal::context(const RawGetRequest* msg) { - return *msg->_impl_.context_; -} -RawGetRequest::RawGetRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawGetRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawGetRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - key_(arena, from.key_), - cf_(arena, from.cf_) {} - -RawGetRequest::RawGetRequest( - ::google::protobuf::Arena* arena, - const RawGetRequest& from) - : ::google::protobuf::Message(arena) { - RawGetRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawGetRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawGetRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - key_(arena), - cf_(arena) {} - -inline void RawGetRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.context_ = {}; -} -RawGetRequest::~RawGetRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawGetRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawGetRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.key_.Destroy(); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawGetRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawGetRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.key_.ClearToEmpty(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawGetRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 3, 1, 32, 2> RawGetRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_._has_bits_), - 0, // no _extensions_ - 3, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap - offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawGetRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_.context_)}}, - // bytes key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_.key_)}}, - // string cf = 3; - {::_pbi::TcParser::FastUS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_.cf_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes key = 2; - {PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_.key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // string cf = 3; - {PROTOBUF_FIELD_OFFSET(RawGetRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\25\0\0\2\0\0\0\0" - "kvrpcpb.RawGetRequest" - "cf" - }}, -}; - -::uint8_t* RawGetRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawGetRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // bytes key = 2; - if (!this->_internal_key().empty()) { - const std::string& _s = this->_internal_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // string cf = 3; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawGetRequest.cf"); - target = stream->WriteStringMaybeAliased(3, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawGetRequest) - return target; -} - -::size_t RawGetRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawGetRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 2; - if (!this->_internal_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_key()); - } - - // string cf = 3; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawGetRequest::_class_data_ = { - RawGetRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawGetRequest::GetClassData() const { - return &_class_data_; -} - -void RawGetRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawGetRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_key().empty()) { - _this->_internal_set_key(from._internal_key()); - } - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawGetRequest::CopyFrom(const RawGetRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawGetRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawGetRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawGetRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawGetRequest::InternalSwap(RawGetRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - swap(_impl_.context_, other->_impl_.context_); -} - -::google::protobuf::Metadata RawGetRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[2]); -} -// =================================================================== - -class RawGetResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawGetResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawGetResponse::_Internal::region_error(const RawGetResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawGetResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawGetResponse::RawGetResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawGetResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawGetResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_), - value_(arena, from.value_) {} - -RawGetResponse::RawGetResponse( - ::google::protobuf::Arena* arena, - const RawGetResponse& from) - : ::google::protobuf::Message(arena) { - RawGetResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - _impl_.not_found_ = from._impl_.not_found_; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawGetResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawGetResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena), - value_(arena) {} - -inline void RawGetResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, region_error_), - 0, - offsetof(Impl_, not_found_) - - offsetof(Impl_, region_error_) + - sizeof(Impl_::not_found_)); -} -RawGetResponse::~RawGetResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawGetResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawGetResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - _impl_.value_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawGetResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawGetResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - _impl_.value_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_.not_found_ = false; - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawGetResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 1, 36, 2> RawGetResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_._has_bits_), - 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap - offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawGetResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bool not_found = 4; - {::_pbi::TcParser::SingularVarintNoZag1(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.not_found_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.region_error_)}}, - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.error_)}}, - // bytes value = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.value_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bytes value = 3; - {PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.value_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bool not_found = 4; - {PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.not_found_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\26\0\5\0\0\0\0\0" - "kvrpcpb.RawGetResponse" - "error" - }}, -}; - -::uint8_t* RawGetResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawGetResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawGetResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - const std::string& _s = this->_internal_value(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - // bool not_found = 4; - if (this->_internal_not_found() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 4, this->_internal_not_found(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawGetResponse) - return target; -} - -::size_t RawGetResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawGetResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_value()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - // bool not_found = 4; - if (this->_internal_not_found() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawGetResponse::_class_data_ = { - RawGetResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawGetResponse::GetClassData() const { - return &_class_data_; -} - -void RawGetResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawGetResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if (!from._internal_value().empty()) { - _this->_internal_set_value(from._internal_value()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - if (from._internal_not_found() != 0) { - _this->_internal_set_not_found(from._internal_not_found()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawGetResponse::CopyFrom(const RawGetResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawGetResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawGetResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawGetResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawGetResponse::InternalSwap(RawGetResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.value_, &other->_impl_.value_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.not_found_) - + sizeof(RawGetResponse::_impl_.not_found_) - - PROTOBUF_FIELD_OFFSET(RawGetResponse, _impl_.region_error_)>( - reinterpret_cast(&_impl_.region_error_), - reinterpret_cast(&other->_impl_.region_error_)); -} - -::google::protobuf::Metadata RawGetResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[3]); -} -// =================================================================== - -class RawBatchGetRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawBatchGetRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawBatchGetRequest::_Internal::context(const RawBatchGetRequest* msg) { - return *msg->_impl_.context_; -} -RawBatchGetRequest::RawBatchGetRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawBatchGetRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchGetRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - keys_{visibility, arena, from.keys_}, - cf_(arena, from.cf_) {} - -RawBatchGetRequest::RawBatchGetRequest( - ::google::protobuf::Arena* arena, - const RawBatchGetRequest& from) - : ::google::protobuf::Message(arena) { - RawBatchGetRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawBatchGetRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchGetRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - keys_{visibility, arena}, - cf_(arena) {} - -inline void RawBatchGetRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.context_ = {}; -} -RawBatchGetRequest::~RawBatchGetRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawBatchGetRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawBatchGetRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawBatchGetRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawBatchGetRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.keys_.Clear(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawBatchGetRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 3, 1, 37, 2> RawBatchGetRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_._has_bits_), - 0, // no _extensions_ - 3, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap - offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawBatchGetRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_.context_)}}, - // repeated bytes keys = 2; - {::_pbi::TcParser::FastBR1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_.keys_)}}, - // string cf = 3; - {::_pbi::TcParser::FastUS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_.cf_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated bytes keys = 2; - {PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_.keys_), -1, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kBytes | ::_fl::kRepSString)}, - // string cf = 3; - {PROTOBUF_FIELD_OFFSET(RawBatchGetRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\32\0\0\2\0\0\0\0" - "kvrpcpb.RawBatchGetRequest" - "cf" - }}, -}; - -::uint8_t* RawBatchGetRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawBatchGetRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // repeated bytes keys = 2; - for (int i = 0, n = this->_internal_keys_size(); i < n; ++i) { - const auto& s = this->_internal_keys().Get(i); - target = stream->WriteBytes(2, s, target); - } - - // string cf = 3; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawBatchGetRequest.cf"); - target = stream->WriteStringMaybeAliased(3, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawBatchGetRequest) - return target; -} - -::size_t RawBatchGetRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawBatchGetRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated bytes keys = 2; - total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_keys().size()); - for (int i = 0, n = _internal_keys().size(); i < n; ++i) { - total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( - _internal_keys().Get(i)); - } - // string cf = 3; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawBatchGetRequest::_class_data_ = { - RawBatchGetRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawBatchGetRequest::GetClassData() const { - return &_class_data_; -} - -void RawBatchGetRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawBatchGetRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_keys()->MergeFrom(from._internal_keys()); - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawBatchGetRequest::CopyFrom(const RawBatchGetRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawBatchGetRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawBatchGetRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawBatchGetRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawBatchGetRequest::InternalSwap(RawBatchGetRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.keys_.InternalSwap(&other->_impl_.keys_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - swap(_impl_.context_, other->_impl_.context_); -} - -::google::protobuf::Metadata RawBatchGetRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[4]); -} -// =================================================================== - -class RawBatchGetResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawBatchGetResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawBatchGetResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawBatchGetResponse::_Internal::region_error(const RawBatchGetResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawBatchGetResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawBatchGetResponse::RawBatchGetResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawBatchGetResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchGetResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - pairs_{visibility, arena, from.pairs_} {} - -RawBatchGetResponse::RawBatchGetResponse( - ::google::protobuf::Arena* arena, - const RawBatchGetResponse& from) - : ::google::protobuf::Message(arena) { - RawBatchGetResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawBatchGetResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchGetResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - pairs_{visibility, arena} {} - -inline void RawBatchGetResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawBatchGetResponse::~RawBatchGetResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawBatchGetResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawBatchGetResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawBatchGetResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawBatchGetResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.pairs_.Clear(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawBatchGetResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 2, 0, 2> RawBatchGetResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawBatchGetResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawBatchGetResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // repeated .kvrpcpb.KvPair pairs = 2; - {::_pbi::TcParser::FastMtR1, - {18, 63, 1, PROTOBUF_FIELD_OFFSET(RawBatchGetResponse, _impl_.pairs_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawBatchGetResponse, _impl_.region_error_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawBatchGetResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated .kvrpcpb.KvPair pairs = 2; - {PROTOBUF_FIELD_OFFSET(RawBatchGetResponse, _impl_.pairs_), -1, 1, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - {::_pbi::TcParser::GetTable<::kvrpcpb::KvPair>()}, - }}, {{ - }}, -}; - -::uint8_t* RawBatchGetResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawBatchGetResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // repeated .kvrpcpb.KvPair pairs = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_pairs_size()); i < n; i++) { - const auto& repfield = this->_internal_pairs().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawBatchGetResponse) - return target; -} - -::size_t RawBatchGetResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawBatchGetResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .kvrpcpb.KvPair pairs = 2; - total_size += 1UL * this->_internal_pairs_size(); - for (const auto& msg : this->_internal_pairs()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawBatchGetResponse::_class_data_ = { - RawBatchGetResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawBatchGetResponse::GetClassData() const { - return &_class_data_; -} - -void RawBatchGetResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawBatchGetResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_pairs()->MergeFrom( - from._internal_pairs()); - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawBatchGetResponse::CopyFrom(const RawBatchGetResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawBatchGetResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawBatchGetResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawBatchGetResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawBatchGetResponse::InternalSwap(RawBatchGetResponse* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.pairs_.InternalSwap(&other->_impl_.pairs_); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawBatchGetResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[5]); -} -// =================================================================== - -class RawPutRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawPutRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawPutRequest::_Internal::context(const RawPutRequest* msg) { - return *msg->_impl_.context_; -} -RawPutRequest::RawPutRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawPutRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawPutRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - key_(arena, from.key_), - value_(arena, from.value_), - cf_(arena, from.cf_) {} - -RawPutRequest::RawPutRequest( - ::google::protobuf::Arena* arena, - const RawPutRequest& from) - : ::google::protobuf::Message(arena) { - RawPutRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, ttl_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, ttl_), - offsetof(Impl_, for_cas_) - - offsetof(Impl_, ttl_) + - sizeof(Impl_::for_cas_)); - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawPutRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawPutRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - key_(arena), - value_(arena), - cf_(arena) {} - -inline void RawPutRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, context_), - 0, - offsetof(Impl_, for_cas_) - - offsetof(Impl_, context_) + - sizeof(Impl_::for_cas_)); -} -RawPutRequest::~RawPutRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawPutRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawPutRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.key_.Destroy(); - _impl_.value_.Destroy(); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawPutRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawPutRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.key_.ClearToEmpty(); - _impl_.value_.ClearToEmpty(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - ::memset(&_impl_.ttl_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.for_cas_) - - reinterpret_cast(&_impl_.ttl_)) + sizeof(_impl_.for_cas_)); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawPutRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 6, 1, 32, 2> RawPutRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_._has_bits_), - 0, // no _extensions_ - 6, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967232, // skipmap - offsetof(decltype(_table_), field_entries), - 6, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawPutRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.context_)}}, - // bytes key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.key_)}}, - // bytes value = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.value_)}}, - // string cf = 4; - {::_pbi::TcParser::FastUS1, - {34, 63, 0, PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.cf_)}}, - // uint64 ttl = 5; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RawPutRequest, _impl_.ttl_), 63>(), - {40, 63, 0, PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.ttl_)}}, - // bool for_cas = 6; - {::_pbi::TcParser::SingularVarintNoZag1(), - {48, 63, 0, PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.for_cas_)}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes key = 2; - {PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes value = 3; - {PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.value_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // string cf = 4; - {PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint64 ttl = 5; - {PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.ttl_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // bool for_cas = 6; - {PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.for_cas_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\25\0\0\0\2\0\0\0" - "kvrpcpb.RawPutRequest" - "cf" - }}, -}; - -::uint8_t* RawPutRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawPutRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // bytes key = 2; - if (!this->_internal_key().empty()) { - const std::string& _s = this->_internal_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - const std::string& _s = this->_internal_value(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - // string cf = 4; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawPutRequest.cf"); - target = stream->WriteStringMaybeAliased(4, _s, target); - } - - // uint64 ttl = 5; - if (this->_internal_ttl() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 5, this->_internal_ttl(), target); - } - - // bool for_cas = 6; - if (this->_internal_for_cas() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 6, this->_internal_for_cas(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawPutRequest) - return target; -} - -::size_t RawPutRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawPutRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 2; - if (!this->_internal_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_key()); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_value()); - } - - // string cf = 4; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - // uint64 ttl = 5; - if (this->_internal_ttl() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_ttl()); - } - - // bool for_cas = 6; - if (this->_internal_for_cas() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawPutRequest::_class_data_ = { - RawPutRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawPutRequest::GetClassData() const { - return &_class_data_; -} - -void RawPutRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawPutRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_key().empty()) { - _this->_internal_set_key(from._internal_key()); - } - if (!from._internal_value().empty()) { - _this->_internal_set_value(from._internal_value()); - } - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - if (from._internal_ttl() != 0) { - _this->_internal_set_ttl(from._internal_ttl()); - } - if (from._internal_for_cas() != 0) { - _this->_internal_set_for_cas(from._internal_for_cas()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawPutRequest::CopyFrom(const RawPutRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawPutRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawPutRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawPutRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawPutRequest::InternalSwap(RawPutRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.value_, &other->_impl_.value_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.for_cas_) - + sizeof(RawPutRequest::_impl_.for_cas_) - - PROTOBUF_FIELD_OFFSET(RawPutRequest, _impl_.context_)>( - reinterpret_cast(&_impl_.context_), - reinterpret_cast(&other->_impl_.context_)); -} - -::google::protobuf::Metadata RawPutRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[6]); -} -// =================================================================== - -class RawPutResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawPutResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawPutResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawPutResponse::_Internal::region_error(const RawPutResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawPutResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawPutResponse::RawPutResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawPutResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawPutResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_) {} - -RawPutResponse::RawPutResponse( - ::google::protobuf::Arena* arena, - const RawPutResponse& from) - : ::google::protobuf::Message(arena) { - RawPutResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawPutResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawPutResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena) {} - -inline void RawPutResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawPutResponse::~RawPutResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawPutResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawPutResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawPutResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawPutResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawPutResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 36, 2> RawPutResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawPutResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawPutResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawPutResponse, _impl_.error_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawPutResponse, _impl_.region_error_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawPutResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawPutResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\26\0\5\0\0\0\0\0" - "kvrpcpb.RawPutResponse" - "error" - }}, -}; - -::uint8_t* RawPutResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawPutResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawPutResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawPutResponse) - return target; -} - -::size_t RawPutResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawPutResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawPutResponse::_class_data_ = { - RawPutResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawPutResponse::GetClassData() const { - return &_class_data_; -} - -void RawPutResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawPutResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawPutResponse::CopyFrom(const RawPutResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawPutResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawPutResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawPutResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawPutResponse::InternalSwap(RawPutResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawPutResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[7]); -} -// =================================================================== - -class RawBatchPutRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawBatchPutRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawBatchPutRequest::_Internal::context(const RawBatchPutRequest* msg) { - return *msg->_impl_.context_; -} -RawBatchPutRequest::RawBatchPutRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawBatchPutRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchPutRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - pairs_{visibility, arena, from.pairs_}, - cf_(arena, from.cf_) {} - -RawBatchPutRequest::RawBatchPutRequest( - ::google::protobuf::Arena* arena, - const RawBatchPutRequest& from) - : ::google::protobuf::Message(arena) { - RawBatchPutRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, ttl_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, ttl_), - offsetof(Impl_, for_cas_) - - offsetof(Impl_, ttl_) + - sizeof(Impl_::for_cas_)); - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawBatchPutRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchPutRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - pairs_{visibility, arena}, - cf_(arena) {} - -inline void RawBatchPutRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, context_), - 0, - offsetof(Impl_, for_cas_) - - offsetof(Impl_, context_) + - sizeof(Impl_::for_cas_)); -} -RawBatchPutRequest::~RawBatchPutRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawBatchPutRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawBatchPutRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawBatchPutRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawBatchPutRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.pairs_.Clear(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - ::memset(&_impl_.ttl_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.for_cas_) - - reinterpret_cast(&_impl_.ttl_)) + sizeof(_impl_.for_cas_)); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawBatchPutRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 2, 37, 2> RawBatchPutRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_._has_bits_), - 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap - offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawBatchPutRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.context_)}}, - // repeated .kvrpcpb.KvPair pairs = 2; - {::_pbi::TcParser::FastMtR1, - {18, 63, 1, PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.pairs_)}}, - // string cf = 3; - {::_pbi::TcParser::FastUS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.cf_)}}, - // uint64 ttl = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RawBatchPutRequest, _impl_.ttl_), 63>(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.ttl_)}}, - // bool for_cas = 5; - {::_pbi::TcParser::SingularVarintNoZag1(), - {40, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.for_cas_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated .kvrpcpb.KvPair pairs = 2; - {PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.pairs_), -1, 1, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // string cf = 3; - {PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint64 ttl = 4; - {PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.ttl_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // bool for_cas = 5; - {PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.for_cas_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - {::_pbi::TcParser::GetTable<::kvrpcpb::KvPair>()}, - }}, {{ - "\32\0\0\2\0\0\0\0" - "kvrpcpb.RawBatchPutRequest" - "cf" - }}, -}; - -::uint8_t* RawBatchPutRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawBatchPutRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // repeated .kvrpcpb.KvPair pairs = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_pairs_size()); i < n; i++) { - const auto& repfield = this->_internal_pairs().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); - } - - // string cf = 3; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawBatchPutRequest.cf"); - target = stream->WriteStringMaybeAliased(3, _s, target); - } - - // uint64 ttl = 4; - if (this->_internal_ttl() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 4, this->_internal_ttl(), target); - } - - // bool for_cas = 5; - if (this->_internal_for_cas() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 5, this->_internal_for_cas(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawBatchPutRequest) - return target; -} - -::size_t RawBatchPutRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawBatchPutRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .kvrpcpb.KvPair pairs = 2; - total_size += 1UL * this->_internal_pairs_size(); - for (const auto& msg : this->_internal_pairs()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - // string cf = 3; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - // uint64 ttl = 4; - if (this->_internal_ttl() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_ttl()); - } - - // bool for_cas = 5; - if (this->_internal_for_cas() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawBatchPutRequest::_class_data_ = { - RawBatchPutRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawBatchPutRequest::GetClassData() const { - return &_class_data_; -} - -void RawBatchPutRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawBatchPutRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_pairs()->MergeFrom( - from._internal_pairs()); - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - if (from._internal_ttl() != 0) { - _this->_internal_set_ttl(from._internal_ttl()); - } - if (from._internal_for_cas() != 0) { - _this->_internal_set_for_cas(from._internal_for_cas()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawBatchPutRequest::CopyFrom(const RawBatchPutRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawBatchPutRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawBatchPutRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawBatchPutRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawBatchPutRequest::InternalSwap(RawBatchPutRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.pairs_.InternalSwap(&other->_impl_.pairs_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.for_cas_) - + sizeof(RawBatchPutRequest::_impl_.for_cas_) - - PROTOBUF_FIELD_OFFSET(RawBatchPutRequest, _impl_.context_)>( - reinterpret_cast(&_impl_.context_), - reinterpret_cast(&other->_impl_.context_)); -} - -::google::protobuf::Metadata RawBatchPutRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[8]); -} -// =================================================================== - -class RawBatchPutResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawBatchPutResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawBatchPutResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawBatchPutResponse::_Internal::region_error(const RawBatchPutResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawBatchPutResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawBatchPutResponse::RawBatchPutResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawBatchPutResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchPutResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_) {} - -RawBatchPutResponse::RawBatchPutResponse( - ::google::protobuf::Arena* arena, - const RawBatchPutResponse& from) - : ::google::protobuf::Message(arena) { - RawBatchPutResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawBatchPutResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchPutResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena) {} - -inline void RawBatchPutResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawBatchPutResponse::~RawBatchPutResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawBatchPutResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawBatchPutResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawBatchPutResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawBatchPutResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawBatchPutResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 41, 2> RawBatchPutResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawBatchPutResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawBatchPutResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchPutResponse, _impl_.error_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawBatchPutResponse, _impl_.region_error_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawBatchPutResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawBatchPutResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\33\0\5\0\0\0\0\0" - "kvrpcpb.RawBatchPutResponse" - "error" - }}, -}; - -::uint8_t* RawBatchPutResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawBatchPutResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawBatchPutResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawBatchPutResponse) - return target; -} - -::size_t RawBatchPutResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawBatchPutResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawBatchPutResponse::_class_data_ = { - RawBatchPutResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawBatchPutResponse::GetClassData() const { - return &_class_data_; -} - -void RawBatchPutResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawBatchPutResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawBatchPutResponse::CopyFrom(const RawBatchPutResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawBatchPutResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawBatchPutResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawBatchPutResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawBatchPutResponse::InternalSwap(RawBatchPutResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawBatchPutResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[9]); -} -// =================================================================== - -class RawDeleteRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawDeleteRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawDeleteRequest::_Internal::context(const RawDeleteRequest* msg) { - return *msg->_impl_.context_; -} -RawDeleteRequest::RawDeleteRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawDeleteRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - key_(arena, from.key_), - cf_(arena, from.cf_) {} - -RawDeleteRequest::RawDeleteRequest( - ::google::protobuf::Arena* arena, - const RawDeleteRequest& from) - : ::google::protobuf::Message(arena) { - RawDeleteRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - _impl_.for_cas_ = from._impl_.for_cas_; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawDeleteRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - key_(arena), - cf_(arena) {} - -inline void RawDeleteRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, context_), - 0, - offsetof(Impl_, for_cas_) - - offsetof(Impl_, context_) + - sizeof(Impl_::for_cas_)); -} -RawDeleteRequest::~RawDeleteRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawDeleteRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawDeleteRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.key_.Destroy(); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawDeleteRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawDeleteRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.key_.ClearToEmpty(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - _impl_.for_cas_ = false; - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawDeleteRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 1, 35, 2> RawDeleteRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_._has_bits_), - 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap - offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawDeleteRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bool for_cas = 4; - {::_pbi::TcParser::SingularVarintNoZag1(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.for_cas_)}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.context_)}}, - // bytes key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.key_)}}, - // string cf = 3; - {::_pbi::TcParser::FastUS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.cf_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes key = 2; - {PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // string cf = 3; - {PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool for_cas = 4; - {PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.for_cas_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\30\0\0\2\0\0\0\0" - "kvrpcpb.RawDeleteRequest" - "cf" - }}, -}; - -::uint8_t* RawDeleteRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawDeleteRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // bytes key = 2; - if (!this->_internal_key().empty()) { - const std::string& _s = this->_internal_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // string cf = 3; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawDeleteRequest.cf"); - target = stream->WriteStringMaybeAliased(3, _s, target); - } - - // bool for_cas = 4; - if (this->_internal_for_cas() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 4, this->_internal_for_cas(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawDeleteRequest) - return target; -} - -::size_t RawDeleteRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawDeleteRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 2; - if (!this->_internal_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_key()); - } - - // string cf = 3; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - // bool for_cas = 4; - if (this->_internal_for_cas() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawDeleteRequest::_class_data_ = { - RawDeleteRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawDeleteRequest::GetClassData() const { - return &_class_data_; -} - -void RawDeleteRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawDeleteRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_key().empty()) { - _this->_internal_set_key(from._internal_key()); - } - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - if (from._internal_for_cas() != 0) { - _this->_internal_set_for_cas(from._internal_for_cas()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawDeleteRequest::CopyFrom(const RawDeleteRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawDeleteRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawDeleteRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawDeleteRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawDeleteRequest::InternalSwap(RawDeleteRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.for_cas_) - + sizeof(RawDeleteRequest::_impl_.for_cas_) - - PROTOBUF_FIELD_OFFSET(RawDeleteRequest, _impl_.context_)>( - reinterpret_cast(&_impl_.context_), - reinterpret_cast(&other->_impl_.context_)); -} - -::google::protobuf::Metadata RawDeleteRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[10]); -} -// =================================================================== - -class RawDeleteResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawDeleteResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawDeleteResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawDeleteResponse::_Internal::region_error(const RawDeleteResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawDeleteResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawDeleteResponse::RawDeleteResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawDeleteResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_) {} - -RawDeleteResponse::RawDeleteResponse( - ::google::protobuf::Arena* arena, - const RawDeleteResponse& from) - : ::google::protobuf::Message(arena) { - RawDeleteResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawDeleteResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena) {} - -inline void RawDeleteResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawDeleteResponse::~RawDeleteResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawDeleteResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawDeleteResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawDeleteResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawDeleteResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawDeleteResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 39, 2> RawDeleteResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawDeleteResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawDeleteResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteResponse, _impl_.error_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawDeleteResponse, _impl_.region_error_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawDeleteResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawDeleteResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\31\0\5\0\0\0\0\0" - "kvrpcpb.RawDeleteResponse" - "error" - }}, -}; - -::uint8_t* RawDeleteResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawDeleteResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawDeleteResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawDeleteResponse) - return target; -} - -::size_t RawDeleteResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawDeleteResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawDeleteResponse::_class_data_ = { - RawDeleteResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawDeleteResponse::GetClassData() const { - return &_class_data_; -} - -void RawDeleteResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawDeleteResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawDeleteResponse::CopyFrom(const RawDeleteResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawDeleteResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawDeleteResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawDeleteResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawDeleteResponse::InternalSwap(RawDeleteResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawDeleteResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[11]); -} -// =================================================================== - -class RawBatchDeleteRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawBatchDeleteRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawBatchDeleteRequest::_Internal::context(const RawBatchDeleteRequest* msg) { - return *msg->_impl_.context_; -} -RawBatchDeleteRequest::RawBatchDeleteRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawBatchDeleteRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchDeleteRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - keys_{visibility, arena, from.keys_}, - cf_(arena, from.cf_) {} - -RawBatchDeleteRequest::RawBatchDeleteRequest( - ::google::protobuf::Arena* arena, - const RawBatchDeleteRequest& from) - : ::google::protobuf::Message(arena) { - RawBatchDeleteRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawBatchDeleteRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchDeleteRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - keys_{visibility, arena}, - cf_(arena) {} - -inline void RawBatchDeleteRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.context_ = {}; -} -RawBatchDeleteRequest::~RawBatchDeleteRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawBatchDeleteRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawBatchDeleteRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawBatchDeleteRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawBatchDeleteRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.keys_.Clear(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawBatchDeleteRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 3, 1, 40, 2> RawBatchDeleteRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_._has_bits_), - 0, // no _extensions_ - 3, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap - offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawBatchDeleteRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_.context_)}}, - // repeated bytes keys = 2; - {::_pbi::TcParser::FastBR1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_.keys_)}}, - // string cf = 3; - {::_pbi::TcParser::FastUS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_.cf_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated bytes keys = 2; - {PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_.keys_), -1, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kBytes | ::_fl::kRepSString)}, - // string cf = 3; - {PROTOBUF_FIELD_OFFSET(RawBatchDeleteRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\35\0\0\2\0\0\0\0" - "kvrpcpb.RawBatchDeleteRequest" - "cf" - }}, -}; - -::uint8_t* RawBatchDeleteRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawBatchDeleteRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // repeated bytes keys = 2; - for (int i = 0, n = this->_internal_keys_size(); i < n; ++i) { - const auto& s = this->_internal_keys().Get(i); - target = stream->WriteBytes(2, s, target); - } - - // string cf = 3; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawBatchDeleteRequest.cf"); - target = stream->WriteStringMaybeAliased(3, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawBatchDeleteRequest) - return target; -} - -::size_t RawBatchDeleteRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawBatchDeleteRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated bytes keys = 2; - total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_keys().size()); - for (int i = 0, n = _internal_keys().size(); i < n; ++i) { - total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( - _internal_keys().Get(i)); - } - // string cf = 3; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawBatchDeleteRequest::_class_data_ = { - RawBatchDeleteRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawBatchDeleteRequest::GetClassData() const { - return &_class_data_; -} - -void RawBatchDeleteRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawBatchDeleteRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_keys()->MergeFrom(from._internal_keys()); - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawBatchDeleteRequest::CopyFrom(const RawBatchDeleteRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawBatchDeleteRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawBatchDeleteRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawBatchDeleteRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawBatchDeleteRequest::InternalSwap(RawBatchDeleteRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.keys_.InternalSwap(&other->_impl_.keys_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - swap(_impl_.context_, other->_impl_.context_); -} - -::google::protobuf::Metadata RawBatchDeleteRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[12]); -} -// =================================================================== - -class RawBatchDeleteResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawBatchDeleteResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawBatchDeleteResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawBatchDeleteResponse::_Internal::region_error(const RawBatchDeleteResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawBatchDeleteResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawBatchDeleteResponse::RawBatchDeleteResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawBatchDeleteResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchDeleteResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_) {} - -RawBatchDeleteResponse::RawBatchDeleteResponse( - ::google::protobuf::Arena* arena, - const RawBatchDeleteResponse& from) - : ::google::protobuf::Message(arena) { - RawBatchDeleteResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawBatchDeleteResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawBatchDeleteResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena) {} - -inline void RawBatchDeleteResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawBatchDeleteResponse::~RawBatchDeleteResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawBatchDeleteResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawBatchDeleteResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawBatchDeleteResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawBatchDeleteResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawBatchDeleteResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 44, 2> RawBatchDeleteResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawBatchDeleteResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawBatchDeleteResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawBatchDeleteResponse, _impl_.error_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawBatchDeleteResponse, _impl_.region_error_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawBatchDeleteResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawBatchDeleteResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\36\0\5\0\0\0\0\0" - "kvrpcpb.RawBatchDeleteResponse" - "error" - }}, -}; - -::uint8_t* RawBatchDeleteResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawBatchDeleteResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawBatchDeleteResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawBatchDeleteResponse) - return target; -} - -::size_t RawBatchDeleteResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawBatchDeleteResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawBatchDeleteResponse::_class_data_ = { - RawBatchDeleteResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawBatchDeleteResponse::GetClassData() const { - return &_class_data_; -} - -void RawBatchDeleteResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawBatchDeleteResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawBatchDeleteResponse::CopyFrom(const RawBatchDeleteResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawBatchDeleteResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawBatchDeleteResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawBatchDeleteResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawBatchDeleteResponse::InternalSwap(RawBatchDeleteResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawBatchDeleteResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[13]); -} -// =================================================================== - -class RawDeleteRangeRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawDeleteRangeRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawDeleteRangeRequest::_Internal::context(const RawDeleteRangeRequest* msg) { - return *msg->_impl_.context_; -} -RawDeleteRangeRequest::RawDeleteRangeRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawDeleteRangeRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteRangeRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - start_key_(arena, from.start_key_), - end_key_(arena, from.end_key_), - cf_(arena, from.cf_) {} - -RawDeleteRangeRequest::RawDeleteRangeRequest( - ::google::protobuf::Arena* arena, - const RawDeleteRangeRequest& from) - : ::google::protobuf::Message(arena) { - RawDeleteRangeRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawDeleteRangeRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteRangeRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - start_key_(arena), - end_key_(arena), - cf_(arena) {} - -inline void RawDeleteRangeRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.context_ = {}; -} -RawDeleteRangeRequest::~RawDeleteRangeRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawDeleteRangeRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawDeleteRangeRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.start_key_.Destroy(); - _impl_.end_key_.Destroy(); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawDeleteRangeRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawDeleteRangeRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.start_key_.ClearToEmpty(); - _impl_.end_key_.ClearToEmpty(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawDeleteRangeRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 1, 40, 2> RawDeleteRangeRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_._has_bits_), - 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap - offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawDeleteRangeRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string cf = 4; - {::_pbi::TcParser::FastUS1, - {34, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.cf_)}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.context_)}}, - // bytes start_key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.start_key_)}}, - // bytes end_key = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.end_key_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes start_key = 2; - {PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.start_key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes end_key = 3; - {PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.end_key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // string cf = 4; - {PROTOBUF_FIELD_OFFSET(RawDeleteRangeRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\35\0\0\0\2\0\0\0" - "kvrpcpb.RawDeleteRangeRequest" - "cf" - }}, -}; - -::uint8_t* RawDeleteRangeRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawDeleteRangeRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // bytes start_key = 2; - if (!this->_internal_start_key().empty()) { - const std::string& _s = this->_internal_start_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // bytes end_key = 3; - if (!this->_internal_end_key().empty()) { - const std::string& _s = this->_internal_end_key(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - // string cf = 4; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawDeleteRangeRequest.cf"); - target = stream->WriteStringMaybeAliased(4, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawDeleteRangeRequest) - return target; -} - -::size_t RawDeleteRangeRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawDeleteRangeRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes start_key = 2; - if (!this->_internal_start_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_start_key()); - } - - // bytes end_key = 3; - if (!this->_internal_end_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_end_key()); - } - - // string cf = 4; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawDeleteRangeRequest::_class_data_ = { - RawDeleteRangeRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawDeleteRangeRequest::GetClassData() const { - return &_class_data_; -} - -void RawDeleteRangeRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawDeleteRangeRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_start_key().empty()) { - _this->_internal_set_start_key(from._internal_start_key()); - } - if (!from._internal_end_key().empty()) { - _this->_internal_set_end_key(from._internal_end_key()); - } - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawDeleteRangeRequest::CopyFrom(const RawDeleteRangeRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawDeleteRangeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawDeleteRangeRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawDeleteRangeRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawDeleteRangeRequest::InternalSwap(RawDeleteRangeRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.start_key_, &other->_impl_.start_key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.end_key_, &other->_impl_.end_key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - swap(_impl_.context_, other->_impl_.context_); -} - -::google::protobuf::Metadata RawDeleteRangeRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[14]); -} -// =================================================================== - -class RawDeleteRangeResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawDeleteRangeResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawDeleteRangeResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawDeleteRangeResponse::_Internal::region_error(const RawDeleteRangeResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawDeleteRangeResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawDeleteRangeResponse::RawDeleteRangeResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawDeleteRangeResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteRangeResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_) {} - -RawDeleteRangeResponse::RawDeleteRangeResponse( - ::google::protobuf::Arena* arena, - const RawDeleteRangeResponse& from) - : ::google::protobuf::Message(arena) { - RawDeleteRangeResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawDeleteRangeResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawDeleteRangeResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena) {} - -inline void RawDeleteRangeResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawDeleteRangeResponse::~RawDeleteRangeResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawDeleteRangeResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawDeleteRangeResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawDeleteRangeResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawDeleteRangeResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawDeleteRangeResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 44, 2> RawDeleteRangeResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawDeleteRangeResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawDeleteRangeResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRangeResponse, _impl_.error_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawDeleteRangeResponse, _impl_.region_error_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawDeleteRangeResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawDeleteRangeResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\36\0\5\0\0\0\0\0" - "kvrpcpb.RawDeleteRangeResponse" - "error" - }}, -}; - -::uint8_t* RawDeleteRangeResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawDeleteRangeResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawDeleteRangeResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawDeleteRangeResponse) - return target; -} - -::size_t RawDeleteRangeResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawDeleteRangeResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawDeleteRangeResponse::_class_data_ = { - RawDeleteRangeResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawDeleteRangeResponse::GetClassData() const { - return &_class_data_; -} - -void RawDeleteRangeResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawDeleteRangeResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawDeleteRangeResponse::CopyFrom(const RawDeleteRangeResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawDeleteRangeResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawDeleteRangeResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawDeleteRangeResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawDeleteRangeResponse::InternalSwap(RawDeleteRangeResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawDeleteRangeResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[15]); -} -// =================================================================== - -class RawCASRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawCASRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawCASRequest::_Internal::context(const RawCASRequest* msg) { - return *msg->_impl_.context_; -} -RawCASRequest::RawCASRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawCASRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawCASRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - key_(arena, from.key_), - value_(arena, from.value_), - previous_value_(arena, from.previous_value_), - cf_(arena, from.cf_) {} - -RawCASRequest::RawCASRequest( - ::google::protobuf::Arena* arena, - const RawCASRequest& from) - : ::google::protobuf::Message(arena) { - RawCASRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, ttl_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, ttl_), - offsetof(Impl_, delete__) - - offsetof(Impl_, ttl_) + - sizeof(Impl_::delete__)); - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawCASRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawCASRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - key_(arena), - value_(arena), - previous_value_(arena), - cf_(arena) {} - -inline void RawCASRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, context_), - 0, - offsetof(Impl_, delete__) - - offsetof(Impl_, context_) + - sizeof(Impl_::delete__)); -} -RawCASRequest::~RawCASRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawCASRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawCASRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.key_.Destroy(); - _impl_.value_.Destroy(); - _impl_.previous_value_.Destroy(); - _impl_.cf_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawCASRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawCASRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.key_.ClearToEmpty(); - _impl_.value_.ClearToEmpty(); - _impl_.previous_value_.ClearToEmpty(); - _impl_.cf_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - ::memset(&_impl_.ttl_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.delete__) - - reinterpret_cast(&_impl_.ttl_)) + sizeof(_impl_.delete__)); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawCASRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 8, 1, 40, 2> RawCASRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_._has_bits_), - 0, // no _extensions_ - 8, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967040, // skipmap - offsetof(decltype(_table_), field_entries), - 8, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawCASRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bool delete = 8; - {::_pbi::TcParser::SingularVarintNoZag1(), - {64, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.delete__)}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.context_)}}, - // bytes key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.key_)}}, - // bytes value = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.value_)}}, - // bool previous_not_exist = 4; - {::_pbi::TcParser::SingularVarintNoZag1(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.previous_not_exist_)}}, - // bytes previous_value = 5; - {::_pbi::TcParser::FastBS1, - {42, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.previous_value_)}}, - // string cf = 6; - {::_pbi::TcParser::FastUS1, - {50, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.cf_)}}, - // uint64 ttl = 7; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RawCASRequest, _impl_.ttl_), 63>(), - {56, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.ttl_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes key = 2; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes value = 3; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.value_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bool previous_not_exist = 4; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.previous_not_exist_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bytes previous_value = 5; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.previous_value_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // string cf = 6; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint64 ttl = 7; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.ttl_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // bool delete = 8; - {PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.delete__), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\25\0\0\0\0\0\2\0\0\0\0\0\0\0\0\0" - "kvrpcpb.RawCASRequest" - "cf" - }}, -}; - -::uint8_t* RawCASRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawCASRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // bytes key = 2; - if (!this->_internal_key().empty()) { - const std::string& _s = this->_internal_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - const std::string& _s = this->_internal_value(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - // bool previous_not_exist = 4; - if (this->_internal_previous_not_exist() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 4, this->_internal_previous_not_exist(), target); - } - - // bytes previous_value = 5; - if (!this->_internal_previous_value().empty()) { - const std::string& _s = this->_internal_previous_value(); - target = stream->WriteBytesMaybeAliased(5, _s, target); - } - - // string cf = 6; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawCASRequest.cf"); - target = stream->WriteStringMaybeAliased(6, _s, target); - } - - // uint64 ttl = 7; - if (this->_internal_ttl() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 7, this->_internal_ttl(), target); - } - - // bool delete = 8; - if (this->_internal_delete_() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 8, this->_internal_delete_(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawCASRequest) - return target; -} - -::size_t RawCASRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawCASRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 2; - if (!this->_internal_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_key()); - } - - // bytes value = 3; - if (!this->_internal_value().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_value()); - } - - // bytes previous_value = 5; - if (!this->_internal_previous_value().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_previous_value()); - } - - // string cf = 6; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - // uint64 ttl = 7; - if (this->_internal_ttl() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_ttl()); - } - - // bool previous_not_exist = 4; - if (this->_internal_previous_not_exist() != 0) { - total_size += 2; - } - - // bool delete = 8; - if (this->_internal_delete_() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawCASRequest::_class_data_ = { - RawCASRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawCASRequest::GetClassData() const { - return &_class_data_; -} - -void RawCASRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawCASRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_key().empty()) { - _this->_internal_set_key(from._internal_key()); - } - if (!from._internal_value().empty()) { - _this->_internal_set_value(from._internal_value()); - } - if (!from._internal_previous_value().empty()) { - _this->_internal_set_previous_value(from._internal_previous_value()); - } - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - if (from._internal_ttl() != 0) { - _this->_internal_set_ttl(from._internal_ttl()); - } - if (from._internal_previous_not_exist() != 0) { - _this->_internal_set_previous_not_exist(from._internal_previous_not_exist()); - } - if (from._internal_delete_() != 0) { - _this->_internal_set_delete_(from._internal_delete_()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawCASRequest::CopyFrom(const RawCASRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawCASRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawCASRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawCASRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawCASRequest::InternalSwap(RawCASRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.value_, &other->_impl_.value_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.previous_value_, &other->_impl_.previous_value_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.delete__) - + sizeof(RawCASRequest::_impl_.delete__) - - PROTOBUF_FIELD_OFFSET(RawCASRequest, _impl_.context_)>( - reinterpret_cast(&_impl_.context_), - reinterpret_cast(&other->_impl_.context_)); -} - -::google::protobuf::Metadata RawCASRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[16]); -} -// =================================================================== - -class RawCASResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawCASResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawCASResponse::_Internal::region_error(const RawCASResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawCASResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawCASResponse::RawCASResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawCASResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawCASResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_), - previous_value_(arena, from.previous_value_) {} - -RawCASResponse::RawCASResponse( - ::google::protobuf::Arena* arena, - const RawCASResponse& from) - : ::google::protobuf::Message(arena) { - RawCASResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, succeed_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, succeed_), - offsetof(Impl_, previous_not_exist_) - - offsetof(Impl_, succeed_) + - sizeof(Impl_::previous_not_exist_)); - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawCASResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawCASResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena), - previous_value_(arena) {} - -inline void RawCASResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, region_error_), - 0, - offsetof(Impl_, previous_not_exist_) - - offsetof(Impl_, region_error_) + - sizeof(Impl_::previous_not_exist_)); -} -RawCASResponse::~RawCASResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawCASResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawCASResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - _impl_.previous_value_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawCASResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawCASResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - _impl_.previous_value_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - ::memset(&_impl_.succeed_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.previous_not_exist_) - - reinterpret_cast(&_impl_.succeed_)) + sizeof(_impl_.previous_not_exist_)); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawCASResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 1, 36, 2> RawCASResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_._has_bits_), - 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap - offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawCASResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.region_error_)}}, - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.error_)}}, - // bool succeed = 3; - {::_pbi::TcParser::SingularVarintNoZag1(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.succeed_)}}, - // bool previous_not_exist = 4; - {::_pbi::TcParser::SingularVarintNoZag1(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.previous_not_exist_)}}, - // bytes previous_value = 5; - {::_pbi::TcParser::FastBS1, - {42, 63, 0, PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.previous_value_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool succeed = 3; - {PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.succeed_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bool previous_not_exist = 4; - {PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.previous_not_exist_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bytes previous_value = 5; - {PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.previous_value_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\26\0\5\0\0\0\0\0" - "kvrpcpb.RawCASResponse" - "error" - }}, -}; - -::uint8_t* RawCASResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawCASResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawCASResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - // bool succeed = 3; - if (this->_internal_succeed() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 3, this->_internal_succeed(), target); - } - - // bool previous_not_exist = 4; - if (this->_internal_previous_not_exist() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 4, this->_internal_previous_not_exist(), target); - } - - // bytes previous_value = 5; - if (!this->_internal_previous_value().empty()) { - const std::string& _s = this->_internal_previous_value(); - target = stream->WriteBytesMaybeAliased(5, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawCASResponse) - return target; -} - -::size_t RawCASResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawCASResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // bytes previous_value = 5; - if (!this->_internal_previous_value().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_previous_value()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - // bool succeed = 3; - if (this->_internal_succeed() != 0) { - total_size += 2; - } - - // bool previous_not_exist = 4; - if (this->_internal_previous_not_exist() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawCASResponse::_class_data_ = { - RawCASResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawCASResponse::GetClassData() const { - return &_class_data_; -} - -void RawCASResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawCASResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if (!from._internal_previous_value().empty()) { - _this->_internal_set_previous_value(from._internal_previous_value()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - if (from._internal_succeed() != 0) { - _this->_internal_set_succeed(from._internal_succeed()); - } - if (from._internal_previous_not_exist() != 0) { - _this->_internal_set_previous_not_exist(from._internal_previous_not_exist()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawCASResponse::CopyFrom(const RawCASResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawCASResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawCASResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawCASResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawCASResponse::InternalSwap(RawCASResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.previous_value_, &other->_impl_.previous_value_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.previous_not_exist_) - + sizeof(RawCASResponse::_impl_.previous_not_exist_) - - PROTOBUF_FIELD_OFFSET(RawCASResponse, _impl_.region_error_)>( - reinterpret_cast(&_impl_.region_error_), - reinterpret_cast(&other->_impl_.region_error_)); -} - -::google::protobuf::Metadata RawCASResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[17]); -} -// =================================================================== - -class RawScanRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawScanRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawScanRequest::_Internal::context(const RawScanRequest* msg) { - return *msg->_impl_.context_; -} -RawScanRequest::RawScanRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawScanRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawScanRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - start_key_(arena, from.start_key_), - cf_(arena, from.cf_), - end_key_(arena, from.end_key_) {} - -RawScanRequest::RawScanRequest( - ::google::protobuf::Arena* arena, - const RawScanRequest& from) - : ::google::protobuf::Message(arena) { - RawScanRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, limit_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, limit_), - offsetof(Impl_, reverse_) - - offsetof(Impl_, limit_) + - sizeof(Impl_::reverse_)); - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawScanRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawScanRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - start_key_(arena), - cf_(arena), - end_key_(arena) {} - -inline void RawScanRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, context_), - 0, - offsetof(Impl_, reverse_) - - offsetof(Impl_, context_) + - sizeof(Impl_::reverse_)); -} -RawScanRequest::~RawScanRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawScanRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawScanRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.start_key_.Destroy(); - _impl_.cf_.Destroy(); - _impl_.end_key_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawScanRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawScanRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.start_key_.ClearToEmpty(); - _impl_.cf_.ClearToEmpty(); - _impl_.end_key_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - ::memset(&_impl_.limit_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.reverse_) - - reinterpret_cast(&_impl_.limit_)) + sizeof(_impl_.reverse_)); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawScanRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 1, 33, 2> RawScanRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_._has_bits_), - 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap - offsetof(decltype(_table_), field_entries), - 7, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawScanRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.context_)}}, - // bytes start_key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.start_key_)}}, - // uint32 limit = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RawScanRequest, _impl_.limit_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.limit_)}}, - // bool key_only = 4; - {::_pbi::TcParser::SingularVarintNoZag1(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.key_only_)}}, - // string cf = 5; - {::_pbi::TcParser::FastUS1, - {42, 63, 0, PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.cf_)}}, - // bool reverse = 6; - {::_pbi::TcParser::SingularVarintNoZag1(), - {48, 63, 0, PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.reverse_)}}, - // bytes end_key = 7; - {::_pbi::TcParser::FastBS1, - {58, 63, 0, PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.end_key_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes start_key = 2; - {PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.start_key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // uint32 limit = 3; - {PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.limit_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, - // bool key_only = 4; - {PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.key_only_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // string cf = 5; - {PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.cf_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bool reverse = 6; - {PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.reverse_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - // bytes end_key = 7; - {PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.end_key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - }}, {{ - "\26\0\0\0\0\2\0\0" - "kvrpcpb.RawScanRequest" - "cf" - }}, -}; - -::uint8_t* RawScanRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawScanRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // bytes start_key = 2; - if (!this->_internal_start_key().empty()) { - const std::string& _s = this->_internal_start_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // uint32 limit = 3; - if (this->_internal_limit() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray( - 3, this->_internal_limit(), target); - } - - // bool key_only = 4; - if (this->_internal_key_only() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 4, this->_internal_key_only(), target); - } - - // string cf = 5; - if (!this->_internal_cf().empty()) { - const std::string& _s = this->_internal_cf(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawScanRequest.cf"); - target = stream->WriteStringMaybeAliased(5, _s, target); - } - - // bool reverse = 6; - if (this->_internal_reverse() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 6, this->_internal_reverse(), target); - } - - // bytes end_key = 7; - if (!this->_internal_end_key().empty()) { - const std::string& _s = this->_internal_end_key(); - target = stream->WriteBytesMaybeAliased(7, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawScanRequest) - return target; -} - -::size_t RawScanRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawScanRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes start_key = 2; - if (!this->_internal_start_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_start_key()); - } - - // string cf = 5; - if (!this->_internal_cf().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_cf()); - } - - // bytes end_key = 7; - if (!this->_internal_end_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_end_key()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - // uint32 limit = 3; - if (this->_internal_limit() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( - this->_internal_limit()); - } - - // bool key_only = 4; - if (this->_internal_key_only() != 0) { - total_size += 2; - } - - // bool reverse = 6; - if (this->_internal_reverse() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawScanRequest::_class_data_ = { - RawScanRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawScanRequest::GetClassData() const { - return &_class_data_; -} - -void RawScanRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawScanRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_start_key().empty()) { - _this->_internal_set_start_key(from._internal_start_key()); - } - if (!from._internal_cf().empty()) { - _this->_internal_set_cf(from._internal_cf()); - } - if (!from._internal_end_key().empty()) { - _this->_internal_set_end_key(from._internal_end_key()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - if (from._internal_limit() != 0) { - _this->_internal_set_limit(from._internal_limit()); - } - if (from._internal_key_only() != 0) { - _this->_internal_set_key_only(from._internal_key_only()); - } - if (from._internal_reverse() != 0) { - _this->_internal_set_reverse(from._internal_reverse()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawScanRequest::CopyFrom(const RawScanRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawScanRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawScanRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawScanRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawScanRequest::InternalSwap(RawScanRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.start_key_, &other->_impl_.start_key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.cf_, &other->_impl_.cf_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.end_key_, &other->_impl_.end_key_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.reverse_) - + sizeof(RawScanRequest::_impl_.reverse_) - - PROTOBUF_FIELD_OFFSET(RawScanRequest, _impl_.context_)>( - reinterpret_cast(&_impl_.context_), - reinterpret_cast(&other->_impl_.context_)); -} - -::google::protobuf::Metadata RawScanRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[18]); -} -// =================================================================== - -class RawScanResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawScanResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawScanResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawScanResponse::_Internal::region_error(const RawScanResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawScanResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawScanResponse::RawScanResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawScanResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawScanResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - kvs_{visibility, arena, from.kvs_} {} - -RawScanResponse::RawScanResponse( - ::google::protobuf::Arena* arena, - const RawScanResponse& from) - : ::google::protobuf::Message(arena) { - RawScanResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawScanResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawScanResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - kvs_{visibility, arena} {} - -inline void RawScanResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawScanResponse::~RawScanResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawScanResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawScanResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawScanResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawScanResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.kvs_.Clear(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawScanResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 2, 0, 2> RawScanResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawScanResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawScanResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // repeated .kvrpcpb.KvPair kvs = 2; - {::_pbi::TcParser::FastMtR1, - {18, 63, 1, PROTOBUF_FIELD_OFFSET(RawScanResponse, _impl_.kvs_)}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawScanResponse, _impl_.region_error_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawScanResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated .kvrpcpb.KvPair kvs = 2; - {PROTOBUF_FIELD_OFFSET(RawScanResponse, _impl_.kvs_), -1, 1, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - {::_pbi::TcParser::GetTable<::kvrpcpb::KvPair>()}, - }}, {{ - }}, -}; - -::uint8_t* RawScanResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawScanResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // repeated .kvrpcpb.KvPair kvs = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_kvs_size()); i < n; i++) { - const auto& repfield = this->_internal_kvs().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawScanResponse) - return target; -} - -::size_t RawScanResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawScanResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .kvrpcpb.KvPair kvs = 2; - total_size += 1UL * this->_internal_kvs_size(); - for (const auto& msg : this->_internal_kvs()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawScanResponse::_class_data_ = { - RawScanResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawScanResponse::GetClassData() const { - return &_class_data_; -} - -void RawScanResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawScanResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_kvs()->MergeFrom( - from._internal_kvs()); - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawScanResponse::CopyFrom(const RawScanResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawScanResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawScanResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawScanResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawScanResponse::InternalSwap(RawScanResponse* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.kvs_.InternalSwap(&other->_impl_.kvs_); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawScanResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[19]); -} -// =================================================================== - -class KeyRange::_Internal { - public: -}; - -KeyRange::KeyRange(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.KeyRange) -} -inline PROTOBUF_NDEBUG_INLINE KeyRange::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : start_key_(arena, from.start_key_), - end_key_(arena, from.end_key_), - _cached_size_{0} {} - -KeyRange::KeyRange( - ::google::protobuf::Arena* arena, - const KeyRange& from) - : ::google::protobuf::Message(arena) { - KeyRange* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.KeyRange) -} -inline PROTOBUF_NDEBUG_INLINE KeyRange::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : start_key_(arena), - end_key_(arena), - _cached_size_{0} {} - -inline void KeyRange::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); -} -KeyRange::~KeyRange() { - // @@protoc_insertion_point(destructor:kvrpcpb.KeyRange) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void KeyRange::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.start_key_.Destroy(); - _impl_.end_key_.Destroy(); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void KeyRange::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.KeyRange) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.start_key_.ClearToEmpty(); - _impl_.end_key_.ClearToEmpty(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* KeyRange::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 0, 2> KeyRange::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_KeyRange_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bytes end_key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(KeyRange, _impl_.end_key_)}}, - // bytes start_key = 1; - {::_pbi::TcParser::FastBS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(KeyRange, _impl_.start_key_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // bytes start_key = 1; - {PROTOBUF_FIELD_OFFSET(KeyRange, _impl_.start_key_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes end_key = 2; - {PROTOBUF_FIELD_OFFSET(KeyRange, _impl_.end_key_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* KeyRange::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.KeyRange) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // bytes start_key = 1; - if (!this->_internal_start_key().empty()) { - const std::string& _s = this->_internal_start_key(); - target = stream->WriteBytesMaybeAliased(1, _s, target); - } - - // bytes end_key = 2; - if (!this->_internal_end_key().empty()) { - const std::string& _s = this->_internal_end_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.KeyRange) - return target; -} - -::size_t KeyRange::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.KeyRange) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes start_key = 1; - if (!this->_internal_start_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_start_key()); - } - - // bytes end_key = 2; - if (!this->_internal_end_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_end_key()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData KeyRange::_class_data_ = { - KeyRange::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* KeyRange::GetClassData() const { - return &_class_data_; -} - -void KeyRange::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.KeyRange) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_start_key().empty()) { - _this->_internal_set_start_key(from._internal_start_key()); - } - if (!from._internal_end_key().empty()) { - _this->_internal_set_end_key(from._internal_end_key()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void KeyRange::CopyFrom(const KeyRange& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.KeyRange) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool KeyRange::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* KeyRange::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void KeyRange::InternalSwap(KeyRange* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.start_key_, &other->_impl_.start_key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.end_key_, &other->_impl_.end_key_, arena); -} - -::google::protobuf::Metadata KeyRange::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[20]); -} -// =================================================================== - -class RawCoprocessorRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_._has_bits_); - static const ::kvrpcpb::Context& context(const RawCoprocessorRequest* msg); - static void set_has_context(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::kvrpcpb::Context& RawCoprocessorRequest::_Internal::context(const RawCoprocessorRequest* msg) { - return *msg->_impl_.context_; -} -RawCoprocessorRequest::RawCoprocessorRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawCoprocessorRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawCoprocessorRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - ranges_{visibility, arena, from.ranges_}, - copr_name_(arena, from.copr_name_), - copr_version_req_(arena, from.copr_version_req_), - data_(arena, from.data_) {} - -RawCoprocessorRequest::RawCoprocessorRequest( - ::google::protobuf::Arena* arena, - const RawCoprocessorRequest& from) - : ::google::protobuf::Message(arena) { - RawCoprocessorRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.context_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::kvrpcpb::Context>(arena, *from._impl_.context_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawCoprocessorRequest) -} -inline PROTOBUF_NDEBUG_INLINE RawCoprocessorRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - ranges_{visibility, arena}, - copr_name_(arena), - copr_version_req_(arena), - data_(arena) {} - -inline void RawCoprocessorRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.context_ = {}; -} -RawCoprocessorRequest::~RawCoprocessorRequest() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawCoprocessorRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawCoprocessorRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.copr_name_.Destroy(); - _impl_.copr_version_req_.Destroy(); - _impl_.data_.Destroy(); - delete _impl_.context_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawCoprocessorRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawCoprocessorRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.ranges_.Clear(); - _impl_.copr_name_.ClearToEmpty(); - _impl_.copr_version_req_.ClearToEmpty(); - _impl_.data_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.context_ != nullptr); - _impl_.context_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawCoprocessorRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 2, 63, 2> RawCoprocessorRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_._has_bits_), - 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap - offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawCoprocessorRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .kvrpcpb.Context context = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.context_)}}, - // string copr_name = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.copr_name_)}}, - // string copr_version_req = 3; - {::_pbi::TcParser::FastUS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.copr_version_req_)}}, - // repeated .kvrpcpb.KeyRange ranges = 4; - {::_pbi::TcParser::FastMtR1, - {34, 63, 1, PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.ranges_)}}, - // bytes data = 5; - {::_pbi::TcParser::FastBS1, - {42, 63, 0, PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.data_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // .kvrpcpb.Context context = 1; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.context_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string copr_name = 2; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.copr_name_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // string copr_version_req = 3; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.copr_version_req_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // repeated .kvrpcpb.KeyRange ranges = 4; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.ranges_), -1, 1, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes data = 5; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorRequest, _impl_.data_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::kvrpcpb::Context>()}, - {::_pbi::TcParser::GetTable<::kvrpcpb::KeyRange>()}, - }}, {{ - "\35\0\11\20\0\0\0\0" - "kvrpcpb.RawCoprocessorRequest" - "copr_name" - "copr_version_req" - }}, -}; - -::uint8_t* RawCoprocessorRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawCoprocessorRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .kvrpcpb.Context context = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::context(this), - _Internal::context(this).GetCachedSize(), target, stream); - } - - // string copr_name = 2; - if (!this->_internal_copr_name().empty()) { - const std::string& _s = this->_internal_copr_name(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawCoprocessorRequest.copr_name"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - // string copr_version_req = 3; - if (!this->_internal_copr_version_req().empty()) { - const std::string& _s = this->_internal_copr_version_req(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawCoprocessorRequest.copr_version_req"); - target = stream->WriteStringMaybeAliased(3, _s, target); - } - - // repeated .kvrpcpb.KeyRange ranges = 4; - for (unsigned i = 0, - n = static_cast(this->_internal_ranges_size()); i < n; i++) { - const auto& repfield = this->_internal_ranges().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); - } - - // bytes data = 5; - if (!this->_internal_data().empty()) { - const std::string& _s = this->_internal_data(); - target = stream->WriteBytesMaybeAliased(5, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawCoprocessorRequest) - return target; -} - -::size_t RawCoprocessorRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawCoprocessorRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .kvrpcpb.KeyRange ranges = 4; - total_size += 1UL * this->_internal_ranges_size(); - for (const auto& msg : this->_internal_ranges()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - // string copr_name = 2; - if (!this->_internal_copr_name().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_copr_name()); - } - - // string copr_version_req = 3; - if (!this->_internal_copr_version_req().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_copr_version_req()); - } - - // bytes data = 5; - if (!this->_internal_data().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_data()); - } - - // .kvrpcpb.Context context = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.context_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawCoprocessorRequest::_class_data_ = { - RawCoprocessorRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawCoprocessorRequest::GetClassData() const { - return &_class_data_; -} - -void RawCoprocessorRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawCoprocessorRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_ranges()->MergeFrom( - from._internal_ranges()); - if (!from._internal_copr_name().empty()) { - _this->_internal_set_copr_name(from._internal_copr_name()); - } - if (!from._internal_copr_version_req().empty()) { - _this->_internal_set_copr_version_req(from._internal_copr_version_req()); - } - if (!from._internal_data().empty()) { - _this->_internal_set_data(from._internal_data()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_context()->::kvrpcpb::Context::MergeFrom( - from._internal_context()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawCoprocessorRequest::CopyFrom(const RawCoprocessorRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawCoprocessorRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawCoprocessorRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawCoprocessorRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawCoprocessorRequest::InternalSwap(RawCoprocessorRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.ranges_.InternalSwap(&other->_impl_.ranges_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.copr_name_, &other->_impl_.copr_name_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.copr_version_req_, &other->_impl_.copr_version_req_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.data_, &other->_impl_.data_, arena); - swap(_impl_.context_, other->_impl_.context_); -} - -::google::protobuf::Metadata RawCoprocessorRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[21]); -} -// =================================================================== - -class RawCoprocessorResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_._has_bits_); - static const ::errorpb::Error& region_error(const RawCoprocessorResponse* msg); - static void set_has_region_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::errorpb::Error& RawCoprocessorResponse::_Internal::region_error(const RawCoprocessorResponse* msg) { - return *msg->_impl_.region_error_; -} -void RawCoprocessorResponse::clear_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_error_ != nullptr) _impl_.region_error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -RawCoprocessorResponse::RawCoprocessorResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:kvrpcpb.RawCoprocessorResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawCoprocessorResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - error_(arena, from.error_), - data_(arena, from.data_) {} - -RawCoprocessorResponse::RawCoprocessorResponse( - ::google::protobuf::Arena* arena, - const RawCoprocessorResponse& from) - : ::google::protobuf::Message(arena) { - RawCoprocessorResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::errorpb::Error>(arena, *from._impl_.region_error_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:kvrpcpb.RawCoprocessorResponse) -} -inline PROTOBUF_NDEBUG_INLINE RawCoprocessorResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - error_(arena), - data_(arena) {} - -inline void RawCoprocessorResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.region_error_ = {}; -} -RawCoprocessorResponse::~RawCoprocessorResponse() { - // @@protoc_insertion_point(destructor:kvrpcpb.RawCoprocessorResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RawCoprocessorResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.error_.Destroy(); - _impl_.data_.Destroy(); - delete _impl_.region_error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RawCoprocessorResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:kvrpcpb.RawCoprocessorResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.error_.ClearToEmpty(); - _impl_.data_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_error_ != nullptr); - _impl_.region_error_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RawCoprocessorResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 3, 1, 44, 2> RawCoprocessorResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_._has_bits_), - 0, // no _extensions_ - 3, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967288, // skipmap - offsetof(decltype(_table_), field_entries), - 3, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_RawCoprocessorResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .errorpb.Error region_error = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_.region_error_)}}, - // string error = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_.error_)}}, - // bytes data = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_.data_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .errorpb.Error region_error = 1; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_.region_error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // string error = 2; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_.error_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // bytes data = 3; - {PROTOBUF_FIELD_OFFSET(RawCoprocessorResponse, _impl_.data_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::errorpb::Error>()}, - }}, {{ - "\36\0\5\0\0\0\0\0" - "kvrpcpb.RawCoprocessorResponse" - "error" - }}, -}; - -::uint8_t* RawCoprocessorResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:kvrpcpb.RawCoprocessorResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .errorpb.Error region_error = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::region_error(this), - _Internal::region_error(this).GetCachedSize(), target, stream); - } - - // string error = 2; - if (!this->_internal_error().empty()) { - const std::string& _s = this->_internal_error(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "kvrpcpb.RawCoprocessorResponse.error"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - // bytes data = 3; - if (!this->_internal_data().empty()) { - const std::string& _s = this->_internal_data(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:kvrpcpb.RawCoprocessorResponse) - return target; -} - -::size_t RawCoprocessorResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:kvrpcpb.RawCoprocessorResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string error = 2; - if (!this->_internal_error().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_error()); - } - - // bytes data = 3; - if (!this->_internal_data().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_data()); - } - - // .errorpb.Error region_error = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_error_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RawCoprocessorResponse::_class_data_ = { - RawCoprocessorResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RawCoprocessorResponse::GetClassData() const { - return &_class_data_; -} - -void RawCoprocessorResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:kvrpcpb.RawCoprocessorResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_error().empty()) { - _this->_internal_set_error(from._internal_error()); - } - if (!from._internal_data().empty()) { - _this->_internal_set_data(from._internal_data()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_error()->::errorpb::Error::MergeFrom( - from._internal_region_error()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RawCoprocessorResponse::CopyFrom(const RawCoprocessorResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:kvrpcpb.RawCoprocessorResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RawCoprocessorResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RawCoprocessorResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RawCoprocessorResponse::InternalSwap(RawCoprocessorResponse* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.data_, &other->_impl_.data_, arena); - swap(_impl_.region_error_, other->_impl_.region_error_); -} - -::google::protobuf::Metadata RawCoprocessorResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_kvrpcpb_2eproto_getter, &descriptor_table_kvrpcpb_2eproto_once, - file_level_metadata_kvrpcpb_2eproto[22]); -} -// @@protoc_insertion_point(namespace_scope) -} // namespace kvrpcpb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google -// @@protoc_insertion_point(global_scope) -#include "google/protobuf/port_undef.inc" diff --git a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.h b/ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.h deleted file mode 100644 index da9d47169..000000000 --- a/ThirdParty/kvproto/generated/kvproto/kvrpcpb.pb.h +++ /dev/null @@ -1,11006 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: kvrpcpb.proto -// Protobuf C++ Version: 4.25.3 - -#ifndef GOOGLE_PROTOBUF_INCLUDED_kvrpcpb_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_kvrpcpb_2eproto_2epb_2eh - -#include -#include -#include -#include - -#include "google/protobuf/port_def.inc" -#if PROTOBUF_VERSION < 4025000 -#error "This file was generated by a newer version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please update" -#error "your headers." -#endif // PROTOBUF_VERSION - -#if 4025003 < PROTOBUF_MIN_PROTOC_VERSION -#error "This file was generated by an older version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please" -#error "regenerate this file with a newer version of protoc." -#endif // PROTOBUF_MIN_PROTOC_VERSION -#include "google/protobuf/port_undef.inc" -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/arena.h" -#include "google/protobuf/arenastring.h" -#include "google/protobuf/generated_message_tctable_decl.h" -#include "google/protobuf/generated_message_util.h" -#include "google/protobuf/metadata_lite.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/message.h" -#include "google/protobuf/repeated_field.h" // IWYU pragma: export -#include "google/protobuf/extension_set.h" // IWYU pragma: export -#include "google/protobuf/generated_enum_reflection.h" -#include "google/protobuf/unknown_field_set.h" -#include "metapb.pb.h" -#include "errorpb.pb.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" - -#define PROTOBUF_INTERNAL_EXPORT_kvrpcpb_2eproto - -namespace google { -namespace protobuf { -namespace internal { -class AnyMetadata; -} // namespace internal -} // namespace protobuf -} // namespace google - -// Internal implementation detail -- do not use these members. -struct TableStruct_kvrpcpb_2eproto { - static const ::uint32_t offsets[]; -}; -extern const ::google::protobuf::internal::DescriptorTable - descriptor_table_kvrpcpb_2eproto; -namespace kvrpcpb { -class Context; -struct ContextDefaultTypeInternal; -extern ContextDefaultTypeInternal _Context_default_instance_; -class KeyRange; -struct KeyRangeDefaultTypeInternal; -extern KeyRangeDefaultTypeInternal _KeyRange_default_instance_; -class KvPair; -struct KvPairDefaultTypeInternal; -extern KvPairDefaultTypeInternal _KvPair_default_instance_; -class RawBatchDeleteRequest; -struct RawBatchDeleteRequestDefaultTypeInternal; -extern RawBatchDeleteRequestDefaultTypeInternal _RawBatchDeleteRequest_default_instance_; -class RawBatchDeleteResponse; -struct RawBatchDeleteResponseDefaultTypeInternal; -extern RawBatchDeleteResponseDefaultTypeInternal _RawBatchDeleteResponse_default_instance_; -class RawBatchGetRequest; -struct RawBatchGetRequestDefaultTypeInternal; -extern RawBatchGetRequestDefaultTypeInternal _RawBatchGetRequest_default_instance_; -class RawBatchGetResponse; -struct RawBatchGetResponseDefaultTypeInternal; -extern RawBatchGetResponseDefaultTypeInternal _RawBatchGetResponse_default_instance_; -class RawBatchPutRequest; -struct RawBatchPutRequestDefaultTypeInternal; -extern RawBatchPutRequestDefaultTypeInternal _RawBatchPutRequest_default_instance_; -class RawBatchPutResponse; -struct RawBatchPutResponseDefaultTypeInternal; -extern RawBatchPutResponseDefaultTypeInternal _RawBatchPutResponse_default_instance_; -class RawCASRequest; -struct RawCASRequestDefaultTypeInternal; -extern RawCASRequestDefaultTypeInternal _RawCASRequest_default_instance_; -class RawCASResponse; -struct RawCASResponseDefaultTypeInternal; -extern RawCASResponseDefaultTypeInternal _RawCASResponse_default_instance_; -class RawCoprocessorRequest; -struct RawCoprocessorRequestDefaultTypeInternal; -extern RawCoprocessorRequestDefaultTypeInternal _RawCoprocessorRequest_default_instance_; -class RawCoprocessorResponse; -struct RawCoprocessorResponseDefaultTypeInternal; -extern RawCoprocessorResponseDefaultTypeInternal _RawCoprocessorResponse_default_instance_; -class RawDeleteRangeRequest; -struct RawDeleteRangeRequestDefaultTypeInternal; -extern RawDeleteRangeRequestDefaultTypeInternal _RawDeleteRangeRequest_default_instance_; -class RawDeleteRangeResponse; -struct RawDeleteRangeResponseDefaultTypeInternal; -extern RawDeleteRangeResponseDefaultTypeInternal _RawDeleteRangeResponse_default_instance_; -class RawDeleteRequest; -struct RawDeleteRequestDefaultTypeInternal; -extern RawDeleteRequestDefaultTypeInternal _RawDeleteRequest_default_instance_; -class RawDeleteResponse; -struct RawDeleteResponseDefaultTypeInternal; -extern RawDeleteResponseDefaultTypeInternal _RawDeleteResponse_default_instance_; -class RawGetRequest; -struct RawGetRequestDefaultTypeInternal; -extern RawGetRequestDefaultTypeInternal _RawGetRequest_default_instance_; -class RawGetResponse; -struct RawGetResponseDefaultTypeInternal; -extern RawGetResponseDefaultTypeInternal _RawGetResponse_default_instance_; -class RawPutRequest; -struct RawPutRequestDefaultTypeInternal; -extern RawPutRequestDefaultTypeInternal _RawPutRequest_default_instance_; -class RawPutResponse; -struct RawPutResponseDefaultTypeInternal; -extern RawPutResponseDefaultTypeInternal _RawPutResponse_default_instance_; -class RawScanRequest; -struct RawScanRequestDefaultTypeInternal; -extern RawScanRequestDefaultTypeInternal _RawScanRequest_default_instance_; -class RawScanResponse; -struct RawScanResponseDefaultTypeInternal; -extern RawScanResponseDefaultTypeInternal _RawScanResponse_default_instance_; -} // namespace kvrpcpb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google - -namespace kvrpcpb { -enum CommandPri : int { - Normal = 0, - Low = 1, - High = 2, - CommandPri_INT_MIN_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::min(), - CommandPri_INT_MAX_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::max(), -}; - -bool CommandPri_IsValid(int value); -extern const uint32_t CommandPri_internal_data_[]; -constexpr CommandPri CommandPri_MIN = static_cast(0); -constexpr CommandPri CommandPri_MAX = static_cast(2); -constexpr int CommandPri_ARRAYSIZE = 2 + 1; -const ::google::protobuf::EnumDescriptor* -CommandPri_descriptor(); -template -const std::string& CommandPri_Name(T value) { - static_assert(std::is_same::value || - std::is_integral::value, - "Incorrect type passed to CommandPri_Name()."); - return CommandPri_Name(static_cast(value)); -} -template <> -inline const std::string& CommandPri_Name(CommandPri value) { - return ::google::protobuf::internal::NameOfDenseEnum( - static_cast(value)); -} -inline bool CommandPri_Parse(absl::string_view name, CommandPri* value) { - return ::google::protobuf::internal::ParseNamedEnum( - CommandPri_descriptor(), name, value); -} -enum IsolationLevel : int { - SI = 0, - RC = 1, - RCCheckTS = 2, - IsolationLevel_INT_MIN_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::min(), - IsolationLevel_INT_MAX_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::max(), -}; - -bool IsolationLevel_IsValid(int value); -extern const uint32_t IsolationLevel_internal_data_[]; -constexpr IsolationLevel IsolationLevel_MIN = static_cast(0); -constexpr IsolationLevel IsolationLevel_MAX = static_cast(2); -constexpr int IsolationLevel_ARRAYSIZE = 2 + 1; -const ::google::protobuf::EnumDescriptor* -IsolationLevel_descriptor(); -template -const std::string& IsolationLevel_Name(T value) { - static_assert(std::is_same::value || - std::is_integral::value, - "Incorrect type passed to IsolationLevel_Name()."); - return IsolationLevel_Name(static_cast(value)); -} -template <> -inline const std::string& IsolationLevel_Name(IsolationLevel value) { - return ::google::protobuf::internal::NameOfDenseEnum( - static_cast(value)); -} -inline bool IsolationLevel_Parse(absl::string_view name, IsolationLevel* value) { - return ::google::protobuf::internal::ParseNamedEnum( - IsolationLevel_descriptor(), name, value); -} - -// =================================================================== - - -// ------------------------------------------------------------------- - -class KeyRange final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.KeyRange) */ { - public: - inline KeyRange() : KeyRange(nullptr) {} - ~KeyRange() override; - template - explicit PROTOBUF_CONSTEXPR KeyRange(::google::protobuf::internal::ConstantInitialized); - - inline KeyRange(const KeyRange& from) - : KeyRange(nullptr, from) {} - KeyRange(KeyRange&& from) noexcept - : KeyRange() { - *this = ::std::move(from); - } - - inline KeyRange& operator=(const KeyRange& from) { - CopyFrom(from); - return *this; - } - inline KeyRange& operator=(KeyRange&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const KeyRange& default_instance() { - return *internal_default_instance(); - } - static inline const KeyRange* internal_default_instance() { - return reinterpret_cast( - &_KeyRange_default_instance_); - } - static constexpr int kIndexInFileMessages = - 20; - - friend void swap(KeyRange& a, KeyRange& b) { - a.Swap(&b); - } - inline void Swap(KeyRange* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(KeyRange* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - KeyRange* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const KeyRange& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const KeyRange& from) { - KeyRange::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(KeyRange* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.KeyRange"; - } - protected: - explicit KeyRange(::google::protobuf::Arena* arena); - KeyRange(::google::protobuf::Arena* arena, const KeyRange& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kStartKeyFieldNumber = 1, - kEndKeyFieldNumber = 2, - }; - // bytes start_key = 1; - void clear_start_key() ; - const std::string& start_key() const; - template - void set_start_key(Arg_&& arg, Args_... args); - std::string* mutable_start_key(); - PROTOBUF_NODISCARD std::string* release_start_key(); - void set_allocated_start_key(std::string* value); - - private: - const std::string& _internal_start_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_start_key( - const std::string& value); - std::string* _internal_mutable_start_key(); - - public: - // bytes end_key = 2; - void clear_end_key() ; - const std::string& end_key() const; - template - void set_end_key(Arg_&& arg, Args_... args); - std::string* mutable_end_key(); - PROTOBUF_NODISCARD std::string* release_end_key(); - void set_allocated_end_key(std::string* value); - - private: - const std::string& _internal_end_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_end_key( - const std::string& value); - std::string* _internal_mutable_end_key(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.KeyRange) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::ArenaStringPtr start_key_; - ::google::protobuf::internal::ArenaStringPtr end_key_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class Context final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.Context) */ { - public: - inline Context() : Context(nullptr) {} - ~Context() override; - template - explicit PROTOBUF_CONSTEXPR Context(::google::protobuf::internal::ConstantInitialized); - - inline Context(const Context& from) - : Context(nullptr, from) {} - Context(Context&& from) noexcept - : Context() { - *this = ::std::move(from); - } - - inline Context& operator=(const Context& from) { - CopyFrom(from); - return *this; - } - inline Context& operator=(Context&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Context& default_instance() { - return *internal_default_instance(); - } - static inline const Context* internal_default_instance() { - return reinterpret_cast( - &_Context_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Context& a, Context& b) { - a.Swap(&b); - } - inline void Swap(Context* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Context* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Context* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Context& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Context& from) { - Context::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Context* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.Context"; - } - protected: - explicit Context(::google::protobuf::Arena* arena); - Context(::google::protobuf::Arena* arena, const Context& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kResolvedLocksFieldNumber = 13, - kResourceGroupNameFieldNumber = 15, - kSourceStmtFieldNumber = 16, - kRegionEpochFieldNumber = 2, - kPeerFieldNumber = 3, - kRegionIdFieldNumber = 1, - kTermFieldNumber = 5, - kPriorityFieldNumber = 6, - kIsolationLevelFieldNumber = 7, - kReadQuorumFieldNumber = 4, - kNotFillCacheFieldNumber = 8, - kSyncLogFieldNumber = 9, - kStaleReadFieldNumber = 10, - kReplicaReadFieldNumber = 12, - kResourceGroupTagFieldNumber = 11, - kMaxExecutionDurationMsFieldNumber = 14, - kRequestSourceFieldNumber = 17, - }; - // repeated uint64 resolved_locks = 13; - int resolved_locks_size() const; - private: - int _internal_resolved_locks_size() const; - - public: - void clear_resolved_locks() ; - ::uint64_t resolved_locks(int index) const; - void set_resolved_locks(int index, ::uint64_t value); - void add_resolved_locks(::uint64_t value); - const ::google::protobuf::RepeatedField<::uint64_t>& resolved_locks() const; - ::google::protobuf::RepeatedField<::uint64_t>* mutable_resolved_locks(); - - private: - const ::google::protobuf::RepeatedField<::uint64_t>& _internal_resolved_locks() const; - ::google::protobuf::RepeatedField<::uint64_t>* _internal_mutable_resolved_locks(); - - public: - // string resource_group_name = 15; - void clear_resource_group_name() ; - const std::string& resource_group_name() const; - template - void set_resource_group_name(Arg_&& arg, Args_... args); - std::string* mutable_resource_group_name(); - PROTOBUF_NODISCARD std::string* release_resource_group_name(); - void set_allocated_resource_group_name(std::string* value); - - private: - const std::string& _internal_resource_group_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_resource_group_name( - const std::string& value); - std::string* _internal_mutable_resource_group_name(); - - public: - // bytes source_stmt = 16; - void clear_source_stmt() ; - const std::string& source_stmt() const; - template - void set_source_stmt(Arg_&& arg, Args_... args); - std::string* mutable_source_stmt(); - PROTOBUF_NODISCARD std::string* release_source_stmt(); - void set_allocated_source_stmt(std::string* value); - - private: - const std::string& _internal_source_stmt() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_source_stmt( - const std::string& value); - std::string* _internal_mutable_source_stmt(); - - public: - // .metapb.RegionEpoch region_epoch = 2; - bool has_region_epoch() const; - void clear_region_epoch() ; - const ::metapb::RegionEpoch& region_epoch() const; - PROTOBUF_NODISCARD ::metapb::RegionEpoch* release_region_epoch(); - ::metapb::RegionEpoch* mutable_region_epoch(); - void set_allocated_region_epoch(::metapb::RegionEpoch* value); - void unsafe_arena_set_allocated_region_epoch(::metapb::RegionEpoch* value); - ::metapb::RegionEpoch* unsafe_arena_release_region_epoch(); - - private: - const ::metapb::RegionEpoch& _internal_region_epoch() const; - ::metapb::RegionEpoch* _internal_mutable_region_epoch(); - - public: - // .metapb.Peer peer = 3; - bool has_peer() const; - void clear_peer() ; - const ::metapb::Peer& peer() const; - PROTOBUF_NODISCARD ::metapb::Peer* release_peer(); - ::metapb::Peer* mutable_peer(); - void set_allocated_peer(::metapb::Peer* value); - void unsafe_arena_set_allocated_peer(::metapb::Peer* value); - ::metapb::Peer* unsafe_arena_release_peer(); - - private: - const ::metapb::Peer& _internal_peer() const; - ::metapb::Peer* _internal_mutable_peer(); - - public: - // uint64 region_id = 1; - void clear_region_id() ; - ::uint64_t region_id() const; - void set_region_id(::uint64_t value); - - private: - ::uint64_t _internal_region_id() const; - void _internal_set_region_id(::uint64_t value); - - public: - // uint64 term = 5; - void clear_term() ; - ::uint64_t term() const; - void set_term(::uint64_t value); - - private: - ::uint64_t _internal_term() const; - void _internal_set_term(::uint64_t value); - - public: - // .kvrpcpb.CommandPri priority = 6; - void clear_priority() ; - ::kvrpcpb::CommandPri priority() const; - void set_priority(::kvrpcpb::CommandPri value); - - private: - ::kvrpcpb::CommandPri _internal_priority() const; - void _internal_set_priority(::kvrpcpb::CommandPri value); - - public: - // .kvrpcpb.IsolationLevel isolation_level = 7; - void clear_isolation_level() ; - ::kvrpcpb::IsolationLevel isolation_level() const; - void set_isolation_level(::kvrpcpb::IsolationLevel value); - - private: - ::kvrpcpb::IsolationLevel _internal_isolation_level() const; - void _internal_set_isolation_level(::kvrpcpb::IsolationLevel value); - - public: - // bool read_quorum = 4; - void clear_read_quorum() ; - bool read_quorum() const; - void set_read_quorum(bool value); - - private: - bool _internal_read_quorum() const; - void _internal_set_read_quorum(bool value); - - public: - // bool not_fill_cache = 8; - void clear_not_fill_cache() ; - bool not_fill_cache() const; - void set_not_fill_cache(bool value); - - private: - bool _internal_not_fill_cache() const; - void _internal_set_not_fill_cache(bool value); - - public: - // bool sync_log = 9; - void clear_sync_log() ; - bool sync_log() const; - void set_sync_log(bool value); - - private: - bool _internal_sync_log() const; - void _internal_set_sync_log(bool value); - - public: - // bool stale_read = 10; - void clear_stale_read() ; - bool stale_read() const; - void set_stale_read(bool value); - - private: - bool _internal_stale_read() const; - void _internal_set_stale_read(bool value); - - public: - // bool replica_read = 12; - void clear_replica_read() ; - bool replica_read() const; - void set_replica_read(bool value); - - private: - bool _internal_replica_read() const; - void _internal_set_replica_read(bool value); - - public: - // uint64 resource_group_tag = 11; - void clear_resource_group_tag() ; - ::uint64_t resource_group_tag() const; - void set_resource_group_tag(::uint64_t value); - - private: - ::uint64_t _internal_resource_group_tag() const; - void _internal_set_resource_group_tag(::uint64_t value); - - public: - // uint64 max_execution_duration_ms = 14; - void clear_max_execution_duration_ms() ; - ::uint64_t max_execution_duration_ms() const; - void set_max_execution_duration_ms(::uint64_t value); - - private: - ::uint64_t _internal_max_execution_duration_ms() const; - void _internal_set_max_execution_duration_ms(::uint64_t value); - - public: - // uint64 request_source = 17; - void clear_request_source() ; - ::uint64_t request_source() const; - void set_request_source(::uint64_t value); - - private: - ::uint64_t _internal_request_source() const; - void _internal_set_request_source(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.Context) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 5, 17, 2, - 59, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedField<::uint64_t> resolved_locks_; - mutable ::google::protobuf::internal::CachedSize _resolved_locks_cached_byte_size_; - ::google::protobuf::internal::ArenaStringPtr resource_group_name_; - ::google::protobuf::internal::ArenaStringPtr source_stmt_; - ::metapb::RegionEpoch* region_epoch_; - ::metapb::Peer* peer_; - ::uint64_t region_id_; - ::uint64_t term_; - int priority_; - int isolation_level_; - bool read_quorum_; - bool not_fill_cache_; - bool sync_log_; - bool stale_read_; - bool replica_read_; - ::uint64_t resource_group_tag_; - ::uint64_t max_execution_duration_ms_; - ::uint64_t request_source_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawScanRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawScanRequest) */ { - public: - inline RawScanRequest() : RawScanRequest(nullptr) {} - ~RawScanRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawScanRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawScanRequest(const RawScanRequest& from) - : RawScanRequest(nullptr, from) {} - RawScanRequest(RawScanRequest&& from) noexcept - : RawScanRequest() { - *this = ::std::move(from); - } - - inline RawScanRequest& operator=(const RawScanRequest& from) { - CopyFrom(from); - return *this; - } - inline RawScanRequest& operator=(RawScanRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawScanRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawScanRequest* internal_default_instance() { - return reinterpret_cast( - &_RawScanRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 18; - - friend void swap(RawScanRequest& a, RawScanRequest& b) { - a.Swap(&b); - } - inline void Swap(RawScanRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawScanRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawScanRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawScanRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawScanRequest& from) { - RawScanRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawScanRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawScanRequest"; - } - protected: - explicit RawScanRequest(::google::protobuf::Arena* arena); - RawScanRequest(::google::protobuf::Arena* arena, const RawScanRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kStartKeyFieldNumber = 2, - kCfFieldNumber = 5, - kEndKeyFieldNumber = 7, - kContextFieldNumber = 1, - kLimitFieldNumber = 3, - kKeyOnlyFieldNumber = 4, - kReverseFieldNumber = 6, - }; - // bytes start_key = 2; - void clear_start_key() ; - const std::string& start_key() const; - template - void set_start_key(Arg_&& arg, Args_... args); - std::string* mutable_start_key(); - PROTOBUF_NODISCARD std::string* release_start_key(); - void set_allocated_start_key(std::string* value); - - private: - const std::string& _internal_start_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_start_key( - const std::string& value); - std::string* _internal_mutable_start_key(); - - public: - // string cf = 5; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // bytes end_key = 7; - void clear_end_key() ; - const std::string& end_key() const; - template - void set_end_key(Arg_&& arg, Args_... args); - std::string* mutable_end_key(); - PROTOBUF_NODISCARD std::string* release_end_key(); - void set_allocated_end_key(std::string* value); - - private: - const std::string& _internal_end_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_end_key( - const std::string& value); - std::string* _internal_mutable_end_key(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // uint32 limit = 3; - void clear_limit() ; - ::uint32_t limit() const; - void set_limit(::uint32_t value); - - private: - ::uint32_t _internal_limit() const; - void _internal_set_limit(::uint32_t value); - - public: - // bool key_only = 4; - void clear_key_only() ; - bool key_only() const; - void set_key_only(bool value); - - private: - bool _internal_key_only() const; - void _internal_set_key_only(bool value); - - public: - // bool reverse = 6; - void clear_reverse() ; - bool reverse() const; - void set_reverse(bool value); - - private: - bool _internal_reverse() const; - void _internal_set_reverse(bool value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawScanRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 7, 1, - 33, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr start_key_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::google::protobuf::internal::ArenaStringPtr end_key_; - ::kvrpcpb::Context* context_; - ::uint32_t limit_; - bool key_only_; - bool reverse_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawPutRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawPutRequest) */ { - public: - inline RawPutRequest() : RawPutRequest(nullptr) {} - ~RawPutRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawPutRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawPutRequest(const RawPutRequest& from) - : RawPutRequest(nullptr, from) {} - RawPutRequest(RawPutRequest&& from) noexcept - : RawPutRequest() { - *this = ::std::move(from); - } - - inline RawPutRequest& operator=(const RawPutRequest& from) { - CopyFrom(from); - return *this; - } - inline RawPutRequest& operator=(RawPutRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawPutRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawPutRequest* internal_default_instance() { - return reinterpret_cast( - &_RawPutRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(RawPutRequest& a, RawPutRequest& b) { - a.Swap(&b); - } - inline void Swap(RawPutRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawPutRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawPutRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawPutRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawPutRequest& from) { - RawPutRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawPutRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawPutRequest"; - } - protected: - explicit RawPutRequest(::google::protobuf::Arena* arena); - RawPutRequest(::google::protobuf::Arena* arena, const RawPutRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 2, - kValueFieldNumber = 3, - kCfFieldNumber = 4, - kContextFieldNumber = 1, - kTtlFieldNumber = 5, - kForCasFieldNumber = 6, - }; - // bytes key = 2; - void clear_key() ; - const std::string& key() const; - template - void set_key(Arg_&& arg, Args_... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* value); - - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key( - const std::string& value); - std::string* _internal_mutable_key(); - - public: - // bytes value = 3; - void clear_value() ; - const std::string& value() const; - template - void set_value(Arg_&& arg, Args_... args); - std::string* mutable_value(); - PROTOBUF_NODISCARD std::string* release_value(); - void set_allocated_value(std::string* value); - - private: - const std::string& _internal_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_value( - const std::string& value); - std::string* _internal_mutable_value(); - - public: - // string cf = 4; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // uint64 ttl = 5; - void clear_ttl() ; - ::uint64_t ttl() const; - void set_ttl(::uint64_t value); - - private: - ::uint64_t _internal_ttl() const; - void _internal_set_ttl(::uint64_t value); - - public: - // bool for_cas = 6; - void clear_for_cas() ; - bool for_cas() const; - void set_for_cas(bool value); - - private: - bool _internal_for_cas() const; - void _internal_set_for_cas(bool value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawPutRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 6, 1, - 32, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr key_; - ::google::protobuf::internal::ArenaStringPtr value_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - ::uint64_t ttl_; - bool for_cas_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawGetRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawGetRequest) */ { - public: - inline RawGetRequest() : RawGetRequest(nullptr) {} - ~RawGetRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawGetRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawGetRequest(const RawGetRequest& from) - : RawGetRequest(nullptr, from) {} - RawGetRequest(RawGetRequest&& from) noexcept - : RawGetRequest() { - *this = ::std::move(from); - } - - inline RawGetRequest& operator=(const RawGetRequest& from) { - CopyFrom(from); - return *this; - } - inline RawGetRequest& operator=(RawGetRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawGetRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawGetRequest* internal_default_instance() { - return reinterpret_cast( - &_RawGetRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(RawGetRequest& a, RawGetRequest& b) { - a.Swap(&b); - } - inline void Swap(RawGetRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawGetRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawGetRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawGetRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawGetRequest& from) { - RawGetRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawGetRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawGetRequest"; - } - protected: - explicit RawGetRequest(::google::protobuf::Arena* arena); - RawGetRequest(::google::protobuf::Arena* arena, const RawGetRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 2, - kCfFieldNumber = 3, - kContextFieldNumber = 1, - }; - // bytes key = 2; - void clear_key() ; - const std::string& key() const; - template - void set_key(Arg_&& arg, Args_... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* value); - - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key( - const std::string& value); - std::string* _internal_mutable_key(); - - public: - // string cf = 3; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawGetRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 3, 1, - 32, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr key_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawDeleteRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawDeleteRequest) */ { - public: - inline RawDeleteRequest() : RawDeleteRequest(nullptr) {} - ~RawDeleteRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawDeleteRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawDeleteRequest(const RawDeleteRequest& from) - : RawDeleteRequest(nullptr, from) {} - RawDeleteRequest(RawDeleteRequest&& from) noexcept - : RawDeleteRequest() { - *this = ::std::move(from); - } - - inline RawDeleteRequest& operator=(const RawDeleteRequest& from) { - CopyFrom(from); - return *this; - } - inline RawDeleteRequest& operator=(RawDeleteRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawDeleteRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawDeleteRequest* internal_default_instance() { - return reinterpret_cast( - &_RawDeleteRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 10; - - friend void swap(RawDeleteRequest& a, RawDeleteRequest& b) { - a.Swap(&b); - } - inline void Swap(RawDeleteRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawDeleteRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawDeleteRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawDeleteRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawDeleteRequest& from) { - RawDeleteRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawDeleteRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawDeleteRequest"; - } - protected: - explicit RawDeleteRequest(::google::protobuf::Arena* arena); - RawDeleteRequest(::google::protobuf::Arena* arena, const RawDeleteRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 2, - kCfFieldNumber = 3, - kContextFieldNumber = 1, - kForCasFieldNumber = 4, - }; - // bytes key = 2; - void clear_key() ; - const std::string& key() const; - template - void set_key(Arg_&& arg, Args_... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* value); - - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key( - const std::string& value); - std::string* _internal_mutable_key(); - - public: - // string cf = 3; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // bool for_cas = 4; - void clear_for_cas() ; - bool for_cas() const; - void set_for_cas(bool value); - - private: - bool _internal_for_cas() const; - void _internal_set_for_cas(bool value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawDeleteRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 4, 1, - 35, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr key_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - bool for_cas_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawDeleteRangeRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawDeleteRangeRequest) */ { - public: - inline RawDeleteRangeRequest() : RawDeleteRangeRequest(nullptr) {} - ~RawDeleteRangeRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawDeleteRangeRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawDeleteRangeRequest(const RawDeleteRangeRequest& from) - : RawDeleteRangeRequest(nullptr, from) {} - RawDeleteRangeRequest(RawDeleteRangeRequest&& from) noexcept - : RawDeleteRangeRequest() { - *this = ::std::move(from); - } - - inline RawDeleteRangeRequest& operator=(const RawDeleteRangeRequest& from) { - CopyFrom(from); - return *this; - } - inline RawDeleteRangeRequest& operator=(RawDeleteRangeRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawDeleteRangeRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawDeleteRangeRequest* internal_default_instance() { - return reinterpret_cast( - &_RawDeleteRangeRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 14; - - friend void swap(RawDeleteRangeRequest& a, RawDeleteRangeRequest& b) { - a.Swap(&b); - } - inline void Swap(RawDeleteRangeRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawDeleteRangeRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawDeleteRangeRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawDeleteRangeRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawDeleteRangeRequest& from) { - RawDeleteRangeRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawDeleteRangeRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawDeleteRangeRequest"; - } - protected: - explicit RawDeleteRangeRequest(::google::protobuf::Arena* arena); - RawDeleteRangeRequest(::google::protobuf::Arena* arena, const RawDeleteRangeRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kStartKeyFieldNumber = 2, - kEndKeyFieldNumber = 3, - kCfFieldNumber = 4, - kContextFieldNumber = 1, - }; - // bytes start_key = 2; - void clear_start_key() ; - const std::string& start_key() const; - template - void set_start_key(Arg_&& arg, Args_... args); - std::string* mutable_start_key(); - PROTOBUF_NODISCARD std::string* release_start_key(); - void set_allocated_start_key(std::string* value); - - private: - const std::string& _internal_start_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_start_key( - const std::string& value); - std::string* _internal_mutable_start_key(); - - public: - // bytes end_key = 3; - void clear_end_key() ; - const std::string& end_key() const; - template - void set_end_key(Arg_&& arg, Args_... args); - std::string* mutable_end_key(); - PROTOBUF_NODISCARD std::string* release_end_key(); - void set_allocated_end_key(std::string* value); - - private: - const std::string& _internal_end_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_end_key( - const std::string& value); - std::string* _internal_mutable_end_key(); - - public: - // string cf = 4; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawDeleteRangeRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 4, 1, - 40, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr start_key_; - ::google::protobuf::internal::ArenaStringPtr end_key_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawCoprocessorRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawCoprocessorRequest) */ { - public: - inline RawCoprocessorRequest() : RawCoprocessorRequest(nullptr) {} - ~RawCoprocessorRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawCoprocessorRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawCoprocessorRequest(const RawCoprocessorRequest& from) - : RawCoprocessorRequest(nullptr, from) {} - RawCoprocessorRequest(RawCoprocessorRequest&& from) noexcept - : RawCoprocessorRequest() { - *this = ::std::move(from); - } - - inline RawCoprocessorRequest& operator=(const RawCoprocessorRequest& from) { - CopyFrom(from); - return *this; - } - inline RawCoprocessorRequest& operator=(RawCoprocessorRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawCoprocessorRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawCoprocessorRequest* internal_default_instance() { - return reinterpret_cast( - &_RawCoprocessorRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 21; - - friend void swap(RawCoprocessorRequest& a, RawCoprocessorRequest& b) { - a.Swap(&b); - } - inline void Swap(RawCoprocessorRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawCoprocessorRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawCoprocessorRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawCoprocessorRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawCoprocessorRequest& from) { - RawCoprocessorRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawCoprocessorRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawCoprocessorRequest"; - } - protected: - explicit RawCoprocessorRequest(::google::protobuf::Arena* arena); - RawCoprocessorRequest(::google::protobuf::Arena* arena, const RawCoprocessorRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRangesFieldNumber = 4, - kCoprNameFieldNumber = 2, - kCoprVersionReqFieldNumber = 3, - kDataFieldNumber = 5, - kContextFieldNumber = 1, - }; - // repeated .kvrpcpb.KeyRange ranges = 4; - int ranges_size() const; - private: - int _internal_ranges_size() const; - - public: - void clear_ranges() ; - ::kvrpcpb::KeyRange* mutable_ranges(int index); - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KeyRange >* - mutable_ranges(); - private: - const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KeyRange>& _internal_ranges() const; - ::google::protobuf::RepeatedPtrField<::kvrpcpb::KeyRange>* _internal_mutable_ranges(); - public: - const ::kvrpcpb::KeyRange& ranges(int index) const; - ::kvrpcpb::KeyRange* add_ranges(); - const ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KeyRange >& - ranges() const; - // string copr_name = 2; - void clear_copr_name() ; - const std::string& copr_name() const; - template - void set_copr_name(Arg_&& arg, Args_... args); - std::string* mutable_copr_name(); - PROTOBUF_NODISCARD std::string* release_copr_name(); - void set_allocated_copr_name(std::string* value); - - private: - const std::string& _internal_copr_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_copr_name( - const std::string& value); - std::string* _internal_mutable_copr_name(); - - public: - // string copr_version_req = 3; - void clear_copr_version_req() ; - const std::string& copr_version_req() const; - template - void set_copr_version_req(Arg_&& arg, Args_... args); - std::string* mutable_copr_version_req(); - PROTOBUF_NODISCARD std::string* release_copr_version_req(); - void set_allocated_copr_version_req(std::string* value); - - private: - const std::string& _internal_copr_version_req() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_copr_version_req( - const std::string& value); - std::string* _internal_mutable_copr_version_req(); - - public: - // bytes data = 5; - void clear_data() ; - const std::string& data() const; - template - void set_data(Arg_&& arg, Args_... args); - std::string* mutable_data(); - PROTOBUF_NODISCARD std::string* release_data(); - void set_allocated_data(std::string* value); - - private: - const std::string& _internal_data() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_data( - const std::string& value); - std::string* _internal_mutable_data(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawCoprocessorRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 5, 2, - 63, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KeyRange > ranges_; - ::google::protobuf::internal::ArenaStringPtr copr_name_; - ::google::protobuf::internal::ArenaStringPtr copr_version_req_; - ::google::protobuf::internal::ArenaStringPtr data_; - ::kvrpcpb::Context* context_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawCASRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawCASRequest) */ { - public: - inline RawCASRequest() : RawCASRequest(nullptr) {} - ~RawCASRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawCASRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawCASRequest(const RawCASRequest& from) - : RawCASRequest(nullptr, from) {} - RawCASRequest(RawCASRequest&& from) noexcept - : RawCASRequest() { - *this = ::std::move(from); - } - - inline RawCASRequest& operator=(const RawCASRequest& from) { - CopyFrom(from); - return *this; - } - inline RawCASRequest& operator=(RawCASRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawCASRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawCASRequest* internal_default_instance() { - return reinterpret_cast( - &_RawCASRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 16; - - friend void swap(RawCASRequest& a, RawCASRequest& b) { - a.Swap(&b); - } - inline void Swap(RawCASRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawCASRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawCASRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawCASRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawCASRequest& from) { - RawCASRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawCASRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawCASRequest"; - } - protected: - explicit RawCASRequest(::google::protobuf::Arena* arena); - RawCASRequest(::google::protobuf::Arena* arena, const RawCASRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 2, - kValueFieldNumber = 3, - kPreviousValueFieldNumber = 5, - kCfFieldNumber = 6, - kContextFieldNumber = 1, - kTtlFieldNumber = 7, - kPreviousNotExistFieldNumber = 4, - kDeleteFieldNumber = 8, - }; - // bytes key = 2; - void clear_key() ; - const std::string& key() const; - template - void set_key(Arg_&& arg, Args_... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* value); - - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key( - const std::string& value); - std::string* _internal_mutable_key(); - - public: - // bytes value = 3; - void clear_value() ; - const std::string& value() const; - template - void set_value(Arg_&& arg, Args_... args); - std::string* mutable_value(); - PROTOBUF_NODISCARD std::string* release_value(); - void set_allocated_value(std::string* value); - - private: - const std::string& _internal_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_value( - const std::string& value); - std::string* _internal_mutable_value(); - - public: - // bytes previous_value = 5; - void clear_previous_value() ; - const std::string& previous_value() const; - template - void set_previous_value(Arg_&& arg, Args_... args); - std::string* mutable_previous_value(); - PROTOBUF_NODISCARD std::string* release_previous_value(); - void set_allocated_previous_value(std::string* value); - - private: - const std::string& _internal_previous_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_previous_value( - const std::string& value); - std::string* _internal_mutable_previous_value(); - - public: - // string cf = 6; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // uint64 ttl = 7; - void clear_ttl() ; - ::uint64_t ttl() const; - void set_ttl(::uint64_t value); - - private: - ::uint64_t _internal_ttl() const; - void _internal_set_ttl(::uint64_t value); - - public: - // bool previous_not_exist = 4; - void clear_previous_not_exist() ; - bool previous_not_exist() const; - void set_previous_not_exist(bool value); - - private: - bool _internal_previous_not_exist() const; - void _internal_set_previous_not_exist(bool value); - - public: - // bool delete = 8; - void clear_delete_() ; - bool delete_() const; - void set_delete_(bool value); - - private: - bool _internal_delete_() const; - void _internal_set_delete_(bool value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawCASRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 8, 1, - 40, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr key_; - ::google::protobuf::internal::ArenaStringPtr value_; - ::google::protobuf::internal::ArenaStringPtr previous_value_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - ::uint64_t ttl_; - bool previous_not_exist_; - bool delete__; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawBatchGetRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawBatchGetRequest) */ { - public: - inline RawBatchGetRequest() : RawBatchGetRequest(nullptr) {} - ~RawBatchGetRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawBatchGetRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawBatchGetRequest(const RawBatchGetRequest& from) - : RawBatchGetRequest(nullptr, from) {} - RawBatchGetRequest(RawBatchGetRequest&& from) noexcept - : RawBatchGetRequest() { - *this = ::std::move(from); - } - - inline RawBatchGetRequest& operator=(const RawBatchGetRequest& from) { - CopyFrom(from); - return *this; - } - inline RawBatchGetRequest& operator=(RawBatchGetRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawBatchGetRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawBatchGetRequest* internal_default_instance() { - return reinterpret_cast( - &_RawBatchGetRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(RawBatchGetRequest& a, RawBatchGetRequest& b) { - a.Swap(&b); - } - inline void Swap(RawBatchGetRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawBatchGetRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawBatchGetRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawBatchGetRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawBatchGetRequest& from) { - RawBatchGetRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawBatchGetRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawBatchGetRequest"; - } - protected: - explicit RawBatchGetRequest(::google::protobuf::Arena* arena); - RawBatchGetRequest(::google::protobuf::Arena* arena, const RawBatchGetRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeysFieldNumber = 2, - kCfFieldNumber = 3, - kContextFieldNumber = 1, - }; - // repeated bytes keys = 2; - int keys_size() const; - private: - int _internal_keys_size() const; - - public: - void clear_keys() ; - const std::string& keys(int index) const; - std::string* mutable_keys(int index); - void set_keys(int index, const std::string& value); - void set_keys(int index, std::string&& value); - void set_keys(int index, const char* value); - void set_keys(int index, const void* value, std::size_t size); - void set_keys(int index, absl::string_view value); - std::string* add_keys(); - void add_keys(const std::string& value); - void add_keys(std::string&& value); - void add_keys(const char* value); - void add_keys(const void* value, std::size_t size); - void add_keys(absl::string_view value); - const ::google::protobuf::RepeatedPtrField& keys() const; - ::google::protobuf::RepeatedPtrField* mutable_keys(); - - private: - const ::google::protobuf::RepeatedPtrField& _internal_keys() const; - ::google::protobuf::RepeatedPtrField* _internal_mutable_keys(); - - public: - // string cf = 3; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawBatchGetRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 3, 1, - 37, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField keys_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawBatchDeleteRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawBatchDeleteRequest) */ { - public: - inline RawBatchDeleteRequest() : RawBatchDeleteRequest(nullptr) {} - ~RawBatchDeleteRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawBatchDeleteRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawBatchDeleteRequest(const RawBatchDeleteRequest& from) - : RawBatchDeleteRequest(nullptr, from) {} - RawBatchDeleteRequest(RawBatchDeleteRequest&& from) noexcept - : RawBatchDeleteRequest() { - *this = ::std::move(from); - } - - inline RawBatchDeleteRequest& operator=(const RawBatchDeleteRequest& from) { - CopyFrom(from); - return *this; - } - inline RawBatchDeleteRequest& operator=(RawBatchDeleteRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawBatchDeleteRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawBatchDeleteRequest* internal_default_instance() { - return reinterpret_cast( - &_RawBatchDeleteRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 12; - - friend void swap(RawBatchDeleteRequest& a, RawBatchDeleteRequest& b) { - a.Swap(&b); - } - inline void Swap(RawBatchDeleteRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawBatchDeleteRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawBatchDeleteRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawBatchDeleteRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawBatchDeleteRequest& from) { - RawBatchDeleteRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawBatchDeleteRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawBatchDeleteRequest"; - } - protected: - explicit RawBatchDeleteRequest(::google::protobuf::Arena* arena); - RawBatchDeleteRequest(::google::protobuf::Arena* arena, const RawBatchDeleteRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeysFieldNumber = 2, - kCfFieldNumber = 3, - kContextFieldNumber = 1, - }; - // repeated bytes keys = 2; - int keys_size() const; - private: - int _internal_keys_size() const; - - public: - void clear_keys() ; - const std::string& keys(int index) const; - std::string* mutable_keys(int index); - void set_keys(int index, const std::string& value); - void set_keys(int index, std::string&& value); - void set_keys(int index, const char* value); - void set_keys(int index, const void* value, std::size_t size); - void set_keys(int index, absl::string_view value); - std::string* add_keys(); - void add_keys(const std::string& value); - void add_keys(std::string&& value); - void add_keys(const char* value); - void add_keys(const void* value, std::size_t size); - void add_keys(absl::string_view value); - const ::google::protobuf::RepeatedPtrField& keys() const; - ::google::protobuf::RepeatedPtrField* mutable_keys(); - - private: - const ::google::protobuf::RepeatedPtrField& _internal_keys() const; - ::google::protobuf::RepeatedPtrField* _internal_mutable_keys(); - - public: - // string cf = 3; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawBatchDeleteRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 3, 1, - 40, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField keys_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawPutResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawPutResponse) */ { - public: - inline RawPutResponse() : RawPutResponse(nullptr) {} - ~RawPutResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawPutResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawPutResponse(const RawPutResponse& from) - : RawPutResponse(nullptr, from) {} - RawPutResponse(RawPutResponse&& from) noexcept - : RawPutResponse() { - *this = ::std::move(from); - } - - inline RawPutResponse& operator=(const RawPutResponse& from) { - CopyFrom(from); - return *this; - } - inline RawPutResponse& operator=(RawPutResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawPutResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawPutResponse* internal_default_instance() { - return reinterpret_cast( - &_RawPutResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(RawPutResponse& a, RawPutResponse& b) { - a.Swap(&b); - } - inline void Swap(RawPutResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawPutResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawPutResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawPutResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawPutResponse& from) { - RawPutResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawPutResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawPutResponse"; - } - protected: - explicit RawPutResponse(::google::protobuf::Arena* arena); - RawPutResponse(::google::protobuf::Arena* arena, const RawPutResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kRegionErrorFieldNumber = 1, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawPutResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 36, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawGetResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawGetResponse) */ { - public: - inline RawGetResponse() : RawGetResponse(nullptr) {} - ~RawGetResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawGetResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawGetResponse(const RawGetResponse& from) - : RawGetResponse(nullptr, from) {} - RawGetResponse(RawGetResponse&& from) noexcept - : RawGetResponse() { - *this = ::std::move(from); - } - - inline RawGetResponse& operator=(const RawGetResponse& from) { - CopyFrom(from); - return *this; - } - inline RawGetResponse& operator=(RawGetResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawGetResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawGetResponse* internal_default_instance() { - return reinterpret_cast( - &_RawGetResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(RawGetResponse& a, RawGetResponse& b) { - a.Swap(&b); - } - inline void Swap(RawGetResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawGetResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawGetResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawGetResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawGetResponse& from) { - RawGetResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawGetResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawGetResponse"; - } - protected: - explicit RawGetResponse(::google::protobuf::Arena* arena); - RawGetResponse(::google::protobuf::Arena* arena, const RawGetResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kValueFieldNumber = 3, - kRegionErrorFieldNumber = 1, - kNotFoundFieldNumber = 4, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // bytes value = 3; - void clear_value() ; - const std::string& value() const; - template - void set_value(Arg_&& arg, Args_... args); - std::string* mutable_value(); - PROTOBUF_NODISCARD std::string* release_value(); - void set_allocated_value(std::string* value); - - private: - const std::string& _internal_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_value( - const std::string& value); - std::string* _internal_mutable_value(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // bool not_found = 4; - void clear_not_found() ; - bool not_found() const; - void set_not_found(bool value); - - private: - bool _internal_not_found() const; - void _internal_set_not_found(bool value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawGetResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 4, 1, - 36, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::google::protobuf::internal::ArenaStringPtr value_; - ::errorpb::Error* region_error_; - bool not_found_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawDeleteResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawDeleteResponse) */ { - public: - inline RawDeleteResponse() : RawDeleteResponse(nullptr) {} - ~RawDeleteResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawDeleteResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawDeleteResponse(const RawDeleteResponse& from) - : RawDeleteResponse(nullptr, from) {} - RawDeleteResponse(RawDeleteResponse&& from) noexcept - : RawDeleteResponse() { - *this = ::std::move(from); - } - - inline RawDeleteResponse& operator=(const RawDeleteResponse& from) { - CopyFrom(from); - return *this; - } - inline RawDeleteResponse& operator=(RawDeleteResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawDeleteResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawDeleteResponse* internal_default_instance() { - return reinterpret_cast( - &_RawDeleteResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 11; - - friend void swap(RawDeleteResponse& a, RawDeleteResponse& b) { - a.Swap(&b); - } - inline void Swap(RawDeleteResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawDeleteResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawDeleteResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawDeleteResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawDeleteResponse& from) { - RawDeleteResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawDeleteResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawDeleteResponse"; - } - protected: - explicit RawDeleteResponse(::google::protobuf::Arena* arena); - RawDeleteResponse(::google::protobuf::Arena* arena, const RawDeleteResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kRegionErrorFieldNumber = 1, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawDeleteResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 39, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawDeleteRangeResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawDeleteRangeResponse) */ { - public: - inline RawDeleteRangeResponse() : RawDeleteRangeResponse(nullptr) {} - ~RawDeleteRangeResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawDeleteRangeResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawDeleteRangeResponse(const RawDeleteRangeResponse& from) - : RawDeleteRangeResponse(nullptr, from) {} - RawDeleteRangeResponse(RawDeleteRangeResponse&& from) noexcept - : RawDeleteRangeResponse() { - *this = ::std::move(from); - } - - inline RawDeleteRangeResponse& operator=(const RawDeleteRangeResponse& from) { - CopyFrom(from); - return *this; - } - inline RawDeleteRangeResponse& operator=(RawDeleteRangeResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawDeleteRangeResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawDeleteRangeResponse* internal_default_instance() { - return reinterpret_cast( - &_RawDeleteRangeResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 15; - - friend void swap(RawDeleteRangeResponse& a, RawDeleteRangeResponse& b) { - a.Swap(&b); - } - inline void Swap(RawDeleteRangeResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawDeleteRangeResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawDeleteRangeResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawDeleteRangeResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawDeleteRangeResponse& from) { - RawDeleteRangeResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawDeleteRangeResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawDeleteRangeResponse"; - } - protected: - explicit RawDeleteRangeResponse(::google::protobuf::Arena* arena); - RawDeleteRangeResponse(::google::protobuf::Arena* arena, const RawDeleteRangeResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kRegionErrorFieldNumber = 1, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawDeleteRangeResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 44, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawCoprocessorResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawCoprocessorResponse) */ { - public: - inline RawCoprocessorResponse() : RawCoprocessorResponse(nullptr) {} - ~RawCoprocessorResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawCoprocessorResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawCoprocessorResponse(const RawCoprocessorResponse& from) - : RawCoprocessorResponse(nullptr, from) {} - RawCoprocessorResponse(RawCoprocessorResponse&& from) noexcept - : RawCoprocessorResponse() { - *this = ::std::move(from); - } - - inline RawCoprocessorResponse& operator=(const RawCoprocessorResponse& from) { - CopyFrom(from); - return *this; - } - inline RawCoprocessorResponse& operator=(RawCoprocessorResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawCoprocessorResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawCoprocessorResponse* internal_default_instance() { - return reinterpret_cast( - &_RawCoprocessorResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 22; - - friend void swap(RawCoprocessorResponse& a, RawCoprocessorResponse& b) { - a.Swap(&b); - } - inline void Swap(RawCoprocessorResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawCoprocessorResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawCoprocessorResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawCoprocessorResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawCoprocessorResponse& from) { - RawCoprocessorResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawCoprocessorResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawCoprocessorResponse"; - } - protected: - explicit RawCoprocessorResponse(::google::protobuf::Arena* arena); - RawCoprocessorResponse(::google::protobuf::Arena* arena, const RawCoprocessorResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kDataFieldNumber = 3, - kRegionErrorFieldNumber = 1, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // bytes data = 3; - void clear_data() ; - const std::string& data() const; - template - void set_data(Arg_&& arg, Args_... args); - std::string* mutable_data(); - PROTOBUF_NODISCARD std::string* release_data(); - void set_allocated_data(std::string* value); - - private: - const std::string& _internal_data() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_data( - const std::string& value); - std::string* _internal_mutable_data(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawCoprocessorResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 3, 1, - 44, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::google::protobuf::internal::ArenaStringPtr data_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawCASResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawCASResponse) */ { - public: - inline RawCASResponse() : RawCASResponse(nullptr) {} - ~RawCASResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawCASResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawCASResponse(const RawCASResponse& from) - : RawCASResponse(nullptr, from) {} - RawCASResponse(RawCASResponse&& from) noexcept - : RawCASResponse() { - *this = ::std::move(from); - } - - inline RawCASResponse& operator=(const RawCASResponse& from) { - CopyFrom(from); - return *this; - } - inline RawCASResponse& operator=(RawCASResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawCASResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawCASResponse* internal_default_instance() { - return reinterpret_cast( - &_RawCASResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 17; - - friend void swap(RawCASResponse& a, RawCASResponse& b) { - a.Swap(&b); - } - inline void Swap(RawCASResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawCASResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawCASResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawCASResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawCASResponse& from) { - RawCASResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawCASResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawCASResponse"; - } - protected: - explicit RawCASResponse(::google::protobuf::Arena* arena); - RawCASResponse(::google::protobuf::Arena* arena, const RawCASResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kPreviousValueFieldNumber = 5, - kRegionErrorFieldNumber = 1, - kSucceedFieldNumber = 3, - kPreviousNotExistFieldNumber = 4, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // bytes previous_value = 5; - void clear_previous_value() ; - const std::string& previous_value() const; - template - void set_previous_value(Arg_&& arg, Args_... args); - std::string* mutable_previous_value(); - PROTOBUF_NODISCARD std::string* release_previous_value(); - void set_allocated_previous_value(std::string* value); - - private: - const std::string& _internal_previous_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_previous_value( - const std::string& value); - std::string* _internal_mutable_previous_value(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // bool succeed = 3; - void clear_succeed() ; - bool succeed() const; - void set_succeed(bool value); - - private: - bool _internal_succeed() const; - void _internal_set_succeed(bool value); - - public: - // bool previous_not_exist = 4; - void clear_previous_not_exist() ; - bool previous_not_exist() const; - void set_previous_not_exist(bool value); - - private: - bool _internal_previous_not_exist() const; - void _internal_set_previous_not_exist(bool value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawCASResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 5, 1, - 36, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::google::protobuf::internal::ArenaStringPtr previous_value_; - ::errorpb::Error* region_error_; - bool succeed_; - bool previous_not_exist_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawBatchPutResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawBatchPutResponse) */ { - public: - inline RawBatchPutResponse() : RawBatchPutResponse(nullptr) {} - ~RawBatchPutResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawBatchPutResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawBatchPutResponse(const RawBatchPutResponse& from) - : RawBatchPutResponse(nullptr, from) {} - RawBatchPutResponse(RawBatchPutResponse&& from) noexcept - : RawBatchPutResponse() { - *this = ::std::move(from); - } - - inline RawBatchPutResponse& operator=(const RawBatchPutResponse& from) { - CopyFrom(from); - return *this; - } - inline RawBatchPutResponse& operator=(RawBatchPutResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawBatchPutResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawBatchPutResponse* internal_default_instance() { - return reinterpret_cast( - &_RawBatchPutResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(RawBatchPutResponse& a, RawBatchPutResponse& b) { - a.Swap(&b); - } - inline void Swap(RawBatchPutResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawBatchPutResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawBatchPutResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawBatchPutResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawBatchPutResponse& from) { - RawBatchPutResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawBatchPutResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawBatchPutResponse"; - } - protected: - explicit RawBatchPutResponse(::google::protobuf::Arena* arena); - RawBatchPutResponse(::google::protobuf::Arena* arena, const RawBatchPutResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kRegionErrorFieldNumber = 1, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawBatchPutResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 41, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawBatchDeleteResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawBatchDeleteResponse) */ { - public: - inline RawBatchDeleteResponse() : RawBatchDeleteResponse(nullptr) {} - ~RawBatchDeleteResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawBatchDeleteResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawBatchDeleteResponse(const RawBatchDeleteResponse& from) - : RawBatchDeleteResponse(nullptr, from) {} - RawBatchDeleteResponse(RawBatchDeleteResponse&& from) noexcept - : RawBatchDeleteResponse() { - *this = ::std::move(from); - } - - inline RawBatchDeleteResponse& operator=(const RawBatchDeleteResponse& from) { - CopyFrom(from); - return *this; - } - inline RawBatchDeleteResponse& operator=(RawBatchDeleteResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawBatchDeleteResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawBatchDeleteResponse* internal_default_instance() { - return reinterpret_cast( - &_RawBatchDeleteResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 13; - - friend void swap(RawBatchDeleteResponse& a, RawBatchDeleteResponse& b) { - a.Swap(&b); - } - inline void Swap(RawBatchDeleteResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawBatchDeleteResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawBatchDeleteResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawBatchDeleteResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawBatchDeleteResponse& from) { - RawBatchDeleteResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawBatchDeleteResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawBatchDeleteResponse"; - } - protected: - explicit RawBatchDeleteResponse(::google::protobuf::Arena* arena); - RawBatchDeleteResponse(::google::protobuf::Arena* arena, const RawBatchDeleteResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kRegionErrorFieldNumber = 1, - }; - // string error = 2; - void clear_error() ; - const std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - std::string* mutable_error(); - PROTOBUF_NODISCARD std::string* release_error(); - void set_allocated_error(std::string* value); - - private: - const std::string& _internal_error() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_error( - const std::string& value); - std::string* _internal_mutable_error(); - - public: - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawBatchDeleteResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 44, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr error_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class KvPair final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.KvPair) */ { - public: - inline KvPair() : KvPair(nullptr) {} - ~KvPair() override; - template - explicit PROTOBUF_CONSTEXPR KvPair(::google::protobuf::internal::ConstantInitialized); - - inline KvPair(const KvPair& from) - : KvPair(nullptr, from) {} - KvPair(KvPair&& from) noexcept - : KvPair() { - *this = ::std::move(from); - } - - inline KvPair& operator=(const KvPair& from) { - CopyFrom(from); - return *this; - } - inline KvPair& operator=(KvPair&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const KvPair& default_instance() { - return *internal_default_instance(); - } - static inline const KvPair* internal_default_instance() { - return reinterpret_cast( - &_KvPair_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(KvPair& a, KvPair& b) { - a.Swap(&b); - } - inline void Swap(KvPair* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(KvPair* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - KvPair* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const KvPair& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const KvPair& from) { - KvPair::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(KvPair* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.KvPair"; - } - protected: - explicit KvPair(::google::protobuf::Arena* arena); - KvPair(::google::protobuf::Arena* arena, const KvPair& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 2, - kValueFieldNumber = 3, - kErrorFieldNumber = 1, - }; - // bytes key = 2; - void clear_key() ; - const std::string& key() const; - template - void set_key(Arg_&& arg, Args_... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* value); - - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key( - const std::string& value); - std::string* _internal_mutable_key(); - - public: - // bytes value = 3; - void clear_value() ; - const std::string& value() const; - template - void set_value(Arg_&& arg, Args_... args); - std::string* mutable_value(); - PROTOBUF_NODISCARD std::string* release_value(); - void set_allocated_value(std::string* value); - - private: - const std::string& _internal_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_value( - const std::string& value); - std::string* _internal_mutable_value(); - - public: - // .errorpb.Error error = 1; - bool has_error() const; - void clear_error() ; - const ::errorpb::Error& error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_error(); - ::errorpb::Error* mutable_error(); - void set_allocated_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_error(); - - private: - const ::errorpb::Error& _internal_error() const; - ::errorpb::Error* _internal_mutable_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.KvPair) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 3, 1, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr key_; - ::google::protobuf::internal::ArenaStringPtr value_; - ::errorpb::Error* error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawScanResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawScanResponse) */ { - public: - inline RawScanResponse() : RawScanResponse(nullptr) {} - ~RawScanResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawScanResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawScanResponse(const RawScanResponse& from) - : RawScanResponse(nullptr, from) {} - RawScanResponse(RawScanResponse&& from) noexcept - : RawScanResponse() { - *this = ::std::move(from); - } - - inline RawScanResponse& operator=(const RawScanResponse& from) { - CopyFrom(from); - return *this; - } - inline RawScanResponse& operator=(RawScanResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawScanResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawScanResponse* internal_default_instance() { - return reinterpret_cast( - &_RawScanResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 19; - - friend void swap(RawScanResponse& a, RawScanResponse& b) { - a.Swap(&b); - } - inline void Swap(RawScanResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawScanResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawScanResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawScanResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawScanResponse& from) { - RawScanResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawScanResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawScanResponse"; - } - protected: - explicit RawScanResponse(::google::protobuf::Arena* arena); - RawScanResponse(::google::protobuf::Arena* arena, const RawScanResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKvsFieldNumber = 2, - kRegionErrorFieldNumber = 1, - }; - // repeated .kvrpcpb.KvPair kvs = 2; - int kvs_size() const; - private: - int _internal_kvs_size() const; - - public: - void clear_kvs() ; - ::kvrpcpb::KvPair* mutable_kvs(int index); - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair >* - mutable_kvs(); - private: - const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& _internal_kvs() const; - ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* _internal_mutable_kvs(); - public: - const ::kvrpcpb::KvPair& kvs(int index) const; - ::kvrpcpb::KvPair* add_kvs(); - const ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair >& - kvs() const; - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawScanResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 2, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair > kvs_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawBatchPutRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawBatchPutRequest) */ { - public: - inline RawBatchPutRequest() : RawBatchPutRequest(nullptr) {} - ~RawBatchPutRequest() override; - template - explicit PROTOBUF_CONSTEXPR RawBatchPutRequest(::google::protobuf::internal::ConstantInitialized); - - inline RawBatchPutRequest(const RawBatchPutRequest& from) - : RawBatchPutRequest(nullptr, from) {} - RawBatchPutRequest(RawBatchPutRequest&& from) noexcept - : RawBatchPutRequest() { - *this = ::std::move(from); - } - - inline RawBatchPutRequest& operator=(const RawBatchPutRequest& from) { - CopyFrom(from); - return *this; - } - inline RawBatchPutRequest& operator=(RawBatchPutRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawBatchPutRequest& default_instance() { - return *internal_default_instance(); - } - static inline const RawBatchPutRequest* internal_default_instance() { - return reinterpret_cast( - &_RawBatchPutRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(RawBatchPutRequest& a, RawBatchPutRequest& b) { - a.Swap(&b); - } - inline void Swap(RawBatchPutRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawBatchPutRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawBatchPutRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawBatchPutRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawBatchPutRequest& from) { - RawBatchPutRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawBatchPutRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawBatchPutRequest"; - } - protected: - explicit RawBatchPutRequest(::google::protobuf::Arena* arena); - RawBatchPutRequest(::google::protobuf::Arena* arena, const RawBatchPutRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPairsFieldNumber = 2, - kCfFieldNumber = 3, - kContextFieldNumber = 1, - kTtlFieldNumber = 4, - kForCasFieldNumber = 5, - }; - // repeated .kvrpcpb.KvPair pairs = 2; - int pairs_size() const; - private: - int _internal_pairs_size() const; - - public: - void clear_pairs() ; - ::kvrpcpb::KvPair* mutable_pairs(int index); - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair >* - mutable_pairs(); - private: - const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& _internal_pairs() const; - ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* _internal_mutable_pairs(); - public: - const ::kvrpcpb::KvPair& pairs(int index) const; - ::kvrpcpb::KvPair* add_pairs(); - const ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair >& - pairs() const; - // string cf = 3; - void clear_cf() ; - const std::string& cf() const; - template - void set_cf(Arg_&& arg, Args_... args); - std::string* mutable_cf(); - PROTOBUF_NODISCARD std::string* release_cf(); - void set_allocated_cf(std::string* value); - - private: - const std::string& _internal_cf() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_cf( - const std::string& value); - std::string* _internal_mutable_cf(); - - public: - // .kvrpcpb.Context context = 1; - bool has_context() const; - void clear_context() ; - const ::kvrpcpb::Context& context() const; - PROTOBUF_NODISCARD ::kvrpcpb::Context* release_context(); - ::kvrpcpb::Context* mutable_context(); - void set_allocated_context(::kvrpcpb::Context* value); - void unsafe_arena_set_allocated_context(::kvrpcpb::Context* value); - ::kvrpcpb::Context* unsafe_arena_release_context(); - - private: - const ::kvrpcpb::Context& _internal_context() const; - ::kvrpcpb::Context* _internal_mutable_context(); - - public: - // uint64 ttl = 4; - void clear_ttl() ; - ::uint64_t ttl() const; - void set_ttl(::uint64_t value); - - private: - ::uint64_t _internal_ttl() const; - void _internal_set_ttl(::uint64_t value); - - public: - // bool for_cas = 5; - void clear_for_cas() ; - bool for_cas() const; - void set_for_cas(bool value); - - private: - bool _internal_for_cas() const; - void _internal_set_for_cas(bool value); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawBatchPutRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 5, 2, - 37, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair > pairs_; - ::google::protobuf::internal::ArenaStringPtr cf_; - ::kvrpcpb::Context* context_; - ::uint64_t ttl_; - bool for_cas_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -};// ------------------------------------------------------------------- - -class RawBatchGetResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:kvrpcpb.RawBatchGetResponse) */ { - public: - inline RawBatchGetResponse() : RawBatchGetResponse(nullptr) {} - ~RawBatchGetResponse() override; - template - explicit PROTOBUF_CONSTEXPR RawBatchGetResponse(::google::protobuf::internal::ConstantInitialized); - - inline RawBatchGetResponse(const RawBatchGetResponse& from) - : RawBatchGetResponse(nullptr, from) {} - RawBatchGetResponse(RawBatchGetResponse&& from) noexcept - : RawBatchGetResponse() { - *this = ::std::move(from); - } - - inline RawBatchGetResponse& operator=(const RawBatchGetResponse& from) { - CopyFrom(from); - return *this; - } - inline RawBatchGetResponse& operator=(RawBatchGetResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RawBatchGetResponse& default_instance() { - return *internal_default_instance(); - } - static inline const RawBatchGetResponse* internal_default_instance() { - return reinterpret_cast( - &_RawBatchGetResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(RawBatchGetResponse& a, RawBatchGetResponse& b) { - a.Swap(&b); - } - inline void Swap(RawBatchGetResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RawBatchGetResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RawBatchGetResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RawBatchGetResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RawBatchGetResponse& from) { - RawBatchGetResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RawBatchGetResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "kvrpcpb.RawBatchGetResponse"; - } - protected: - explicit RawBatchGetResponse(::google::protobuf::Arena* arena); - RawBatchGetResponse(::google::protobuf::Arena* arena, const RawBatchGetResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPairsFieldNumber = 2, - kRegionErrorFieldNumber = 1, - }; - // repeated .kvrpcpb.KvPair pairs = 2; - int pairs_size() const; - private: - int _internal_pairs_size() const; - - public: - void clear_pairs() ; - ::kvrpcpb::KvPair* mutable_pairs(int index); - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair >* - mutable_pairs(); - private: - const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& _internal_pairs() const; - ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* _internal_mutable_pairs(); - public: - const ::kvrpcpb::KvPair& pairs(int index) const; - ::kvrpcpb::KvPair* add_pairs(); - const ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair >& - pairs() const; - // .errorpb.Error region_error = 1; - bool has_region_error() const; - void clear_region_error() ; - const ::errorpb::Error& region_error() const; - PROTOBUF_NODISCARD ::errorpb::Error* release_region_error(); - ::errorpb::Error* mutable_region_error(); - void set_allocated_region_error(::errorpb::Error* value); - void unsafe_arena_set_allocated_region_error(::errorpb::Error* value); - ::errorpb::Error* unsafe_arena_release_region_error(); - - private: - const ::errorpb::Error& _internal_region_error() const; - ::errorpb::Error* _internal_mutable_region_error(); - - public: - // @@protoc_insertion_point(class_scope:kvrpcpb.RawBatchGetResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 2, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField< ::kvrpcpb::KvPair > pairs_; - ::errorpb::Error* region_error_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_kvrpcpb_2eproto; -}; - -// =================================================================== - - - - -// =================================================================== - - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// Context - -// uint64 region_id = 1; -inline void Context::clear_region_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.region_id_ = ::uint64_t{0u}; -} -inline ::uint64_t Context::region_id() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.region_id) - return _internal_region_id(); -} -inline void Context::set_region_id(::uint64_t value) { - _internal_set_region_id(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.region_id) -} -inline ::uint64_t Context::_internal_region_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.region_id_; -} -inline void Context::_internal_set_region_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.region_id_ = value; -} - -// .metapb.RegionEpoch region_epoch = 2; -inline bool Context::has_region_epoch() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_epoch_ != nullptr); - return value; -} -inline const ::metapb::RegionEpoch& Context::_internal_region_epoch() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::metapb::RegionEpoch* p = _impl_.region_epoch_; - return p != nullptr ? *p : reinterpret_cast(::metapb::_RegionEpoch_default_instance_); -} -inline const ::metapb::RegionEpoch& Context::region_epoch() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.region_epoch) - return _internal_region_epoch(); -} -inline void Context::unsafe_arena_set_allocated_region_epoch(::metapb::RegionEpoch* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_epoch_); - } - _impl_.region_epoch_ = reinterpret_cast<::metapb::RegionEpoch*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.Context.region_epoch) -} -inline ::metapb::RegionEpoch* Context::release_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::metapb::RegionEpoch* released = _impl_.region_epoch_; - _impl_.region_epoch_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::metapb::RegionEpoch* Context::unsafe_arena_release_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.Context.region_epoch) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::metapb::RegionEpoch* temp = _impl_.region_epoch_; - _impl_.region_epoch_ = nullptr; - return temp; -} -inline ::metapb::RegionEpoch* Context::_internal_mutable_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_epoch_ == nullptr) { - auto* p = CreateMaybeMessage<::metapb::RegionEpoch>(GetArena()); - _impl_.region_epoch_ = reinterpret_cast<::metapb::RegionEpoch*>(p); - } - return _impl_.region_epoch_; -} -inline ::metapb::RegionEpoch* Context::mutable_region_epoch() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::metapb::RegionEpoch* _msg = _internal_mutable_region_epoch(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.Context.region_epoch) - return _msg; -} -inline void Context::set_allocated_region_epoch(::metapb::RegionEpoch* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_epoch_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_epoch_ = reinterpret_cast<::metapb::RegionEpoch*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.Context.region_epoch) -} - -// .metapb.Peer peer = 3; -inline bool Context::has_peer() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.peer_ != nullptr); - return value; -} -inline const ::metapb::Peer& Context::_internal_peer() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::metapb::Peer* p = _impl_.peer_; - return p != nullptr ? *p : reinterpret_cast(::metapb::_Peer_default_instance_); -} -inline const ::metapb::Peer& Context::peer() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.peer) - return _internal_peer(); -} -inline void Context::unsafe_arena_set_allocated_peer(::metapb::Peer* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.peer_); - } - _impl_.peer_ = reinterpret_cast<::metapb::Peer*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.Context.peer) -} -inline ::metapb::Peer* Context::release_peer() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000002u; - ::metapb::Peer* released = _impl_.peer_; - _impl_.peer_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::metapb::Peer* Context::unsafe_arena_release_peer() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.Context.peer) - - _impl_._has_bits_[0] &= ~0x00000002u; - ::metapb::Peer* temp = _impl_.peer_; - _impl_.peer_ = nullptr; - return temp; -} -inline ::metapb::Peer* Context::_internal_mutable_peer() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.peer_ == nullptr) { - auto* p = CreateMaybeMessage<::metapb::Peer>(GetArena()); - _impl_.peer_ = reinterpret_cast<::metapb::Peer*>(p); - } - return _impl_.peer_; -} -inline ::metapb::Peer* Context::mutable_peer() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::metapb::Peer* _msg = _internal_mutable_peer(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.Context.peer) - return _msg; -} -inline void Context::set_allocated_peer(::metapb::Peer* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.peer_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - - _impl_.peer_ = reinterpret_cast<::metapb::Peer*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.Context.peer) -} - -// bool read_quorum = 4; -inline void Context::clear_read_quorum() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.read_quorum_ = false; -} -inline bool Context::read_quorum() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.read_quorum) - return _internal_read_quorum(); -} -inline void Context::set_read_quorum(bool value) { - _internal_set_read_quorum(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.read_quorum) -} -inline bool Context::_internal_read_quorum() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.read_quorum_; -} -inline void Context::_internal_set_read_quorum(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.read_quorum_ = value; -} - -// uint64 term = 5; -inline void Context::clear_term() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.term_ = ::uint64_t{0u}; -} -inline ::uint64_t Context::term() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.term) - return _internal_term(); -} -inline void Context::set_term(::uint64_t value) { - _internal_set_term(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.term) -} -inline ::uint64_t Context::_internal_term() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.term_; -} -inline void Context::_internal_set_term(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.term_ = value; -} - -// .kvrpcpb.CommandPri priority = 6; -inline void Context::clear_priority() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.priority_ = 0; -} -inline ::kvrpcpb::CommandPri Context::priority() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.priority) - return _internal_priority(); -} -inline void Context::set_priority(::kvrpcpb::CommandPri value) { - _internal_set_priority(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.priority) -} -inline ::kvrpcpb::CommandPri Context::_internal_priority() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::kvrpcpb::CommandPri>(_impl_.priority_); -} -inline void Context::_internal_set_priority(::kvrpcpb::CommandPri value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.priority_ = value; -} - -// .kvrpcpb.IsolationLevel isolation_level = 7; -inline void Context::clear_isolation_level() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.isolation_level_ = 0; -} -inline ::kvrpcpb::IsolationLevel Context::isolation_level() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.isolation_level) - return _internal_isolation_level(); -} -inline void Context::set_isolation_level(::kvrpcpb::IsolationLevel value) { - _internal_set_isolation_level(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.isolation_level) -} -inline ::kvrpcpb::IsolationLevel Context::_internal_isolation_level() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::kvrpcpb::IsolationLevel>(_impl_.isolation_level_); -} -inline void Context::_internal_set_isolation_level(::kvrpcpb::IsolationLevel value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.isolation_level_ = value; -} - -// bool not_fill_cache = 8; -inline void Context::clear_not_fill_cache() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.not_fill_cache_ = false; -} -inline bool Context::not_fill_cache() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.not_fill_cache) - return _internal_not_fill_cache(); -} -inline void Context::set_not_fill_cache(bool value) { - _internal_set_not_fill_cache(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.not_fill_cache) -} -inline bool Context::_internal_not_fill_cache() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.not_fill_cache_; -} -inline void Context::_internal_set_not_fill_cache(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.not_fill_cache_ = value; -} - -// bool sync_log = 9; -inline void Context::clear_sync_log() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.sync_log_ = false; -} -inline bool Context::sync_log() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.sync_log) - return _internal_sync_log(); -} -inline void Context::set_sync_log(bool value) { - _internal_set_sync_log(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.sync_log) -} -inline bool Context::_internal_sync_log() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.sync_log_; -} -inline void Context::_internal_set_sync_log(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.sync_log_ = value; -} - -// bool stale_read = 10; -inline void Context::clear_stale_read() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.stale_read_ = false; -} -inline bool Context::stale_read() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.stale_read) - return _internal_stale_read(); -} -inline void Context::set_stale_read(bool value) { - _internal_set_stale_read(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.stale_read) -} -inline bool Context::_internal_stale_read() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.stale_read_; -} -inline void Context::_internal_set_stale_read(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.stale_read_ = value; -} - -// uint64 resource_group_tag = 11; -inline void Context::clear_resource_group_tag() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.resource_group_tag_ = ::uint64_t{0u}; -} -inline ::uint64_t Context::resource_group_tag() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.resource_group_tag) - return _internal_resource_group_tag(); -} -inline void Context::set_resource_group_tag(::uint64_t value) { - _internal_set_resource_group_tag(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.resource_group_tag) -} -inline ::uint64_t Context::_internal_resource_group_tag() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.resource_group_tag_; -} -inline void Context::_internal_set_resource_group_tag(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.resource_group_tag_ = value; -} - -// bool replica_read = 12; -inline void Context::clear_replica_read() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.replica_read_ = false; -} -inline bool Context::replica_read() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.replica_read) - return _internal_replica_read(); -} -inline void Context::set_replica_read(bool value) { - _internal_set_replica_read(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.replica_read) -} -inline bool Context::_internal_replica_read() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.replica_read_; -} -inline void Context::_internal_set_replica_read(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.replica_read_ = value; -} - -// repeated uint64 resolved_locks = 13; -inline int Context::_internal_resolved_locks_size() const { - return _internal_resolved_locks().size(); -} -inline int Context::resolved_locks_size() const { - return _internal_resolved_locks_size(); -} -inline void Context::clear_resolved_locks() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.resolved_locks_.Clear(); -} -inline ::uint64_t Context::resolved_locks(int index) const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.resolved_locks) - return _internal_resolved_locks().Get(index); -} -inline void Context::set_resolved_locks(int index, ::uint64_t value) { - _internal_mutable_resolved_locks()->Set(index, value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.resolved_locks) -} -inline void Context::add_resolved_locks(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_resolved_locks()->Add(value); - // @@protoc_insertion_point(field_add:kvrpcpb.Context.resolved_locks) -} -inline const ::google::protobuf::RepeatedField<::uint64_t>& Context::resolved_locks() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:kvrpcpb.Context.resolved_locks) - return _internal_resolved_locks(); -} -inline ::google::protobuf::RepeatedField<::uint64_t>* Context::mutable_resolved_locks() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:kvrpcpb.Context.resolved_locks) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_resolved_locks(); -} -inline const ::google::protobuf::RepeatedField<::uint64_t>& Context::_internal_resolved_locks() - const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.resolved_locks_; -} -inline ::google::protobuf::RepeatedField<::uint64_t>* Context::_internal_mutable_resolved_locks() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.resolved_locks_; -} - -// uint64 max_execution_duration_ms = 14; -inline void Context::clear_max_execution_duration_ms() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.max_execution_duration_ms_ = ::uint64_t{0u}; -} -inline ::uint64_t Context::max_execution_duration_ms() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.max_execution_duration_ms) - return _internal_max_execution_duration_ms(); -} -inline void Context::set_max_execution_duration_ms(::uint64_t value) { - _internal_set_max_execution_duration_ms(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.max_execution_duration_ms) -} -inline ::uint64_t Context::_internal_max_execution_duration_ms() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.max_execution_duration_ms_; -} -inline void Context::_internal_set_max_execution_duration_ms(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.max_execution_duration_ms_ = value; -} - -// string resource_group_name = 15; -inline void Context::clear_resource_group_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.resource_group_name_.ClearToEmpty(); -} -inline const std::string& Context::resource_group_name() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.resource_group_name) - return _internal_resource_group_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Context::set_resource_group_name(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.resource_group_name_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.resource_group_name) -} -inline std::string* Context::mutable_resource_group_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_resource_group_name(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.Context.resource_group_name) - return _s; -} -inline const std::string& Context::_internal_resource_group_name() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.resource_group_name_.Get(); -} -inline void Context::_internal_set_resource_group_name(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.resource_group_name_.Set(value, GetArena()); -} -inline std::string* Context::_internal_mutable_resource_group_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.resource_group_name_.Mutable( GetArena()); -} -inline std::string* Context::release_resource_group_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.Context.resource_group_name) - return _impl_.resource_group_name_.Release(); -} -inline void Context::set_allocated_resource_group_name(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.resource_group_name_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.resource_group_name_.IsDefault()) { - _impl_.resource_group_name_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.Context.resource_group_name) -} - -// bytes source_stmt = 16; -inline void Context::clear_source_stmt() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.source_stmt_.ClearToEmpty(); -} -inline const std::string& Context::source_stmt() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.source_stmt) - return _internal_source_stmt(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Context::set_source_stmt(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.source_stmt_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.source_stmt) -} -inline std::string* Context::mutable_source_stmt() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_source_stmt(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.Context.source_stmt) - return _s; -} -inline const std::string& Context::_internal_source_stmt() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.source_stmt_.Get(); -} -inline void Context::_internal_set_source_stmt(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.source_stmt_.Set(value, GetArena()); -} -inline std::string* Context::_internal_mutable_source_stmt() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.source_stmt_.Mutable( GetArena()); -} -inline std::string* Context::release_source_stmt() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.Context.source_stmt) - return _impl_.source_stmt_.Release(); -} -inline void Context::set_allocated_source_stmt(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.source_stmt_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.source_stmt_.IsDefault()) { - _impl_.source_stmt_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.Context.source_stmt) -} - -// uint64 request_source = 17; -inline void Context::clear_request_source() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.request_source_ = ::uint64_t{0u}; -} -inline ::uint64_t Context::request_source() const { - // @@protoc_insertion_point(field_get:kvrpcpb.Context.request_source) - return _internal_request_source(); -} -inline void Context::set_request_source(::uint64_t value) { - _internal_set_request_source(value); - // @@protoc_insertion_point(field_set:kvrpcpb.Context.request_source) -} -inline ::uint64_t Context::_internal_request_source() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.request_source_; -} -inline void Context::_internal_set_request_source(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.request_source_ = value; -} - -// ------------------------------------------------------------------- - -// KvPair - -// .errorpb.Error error = 1; -inline bool KvPair::has_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.error_ != nullptr); - return value; -} -inline const ::errorpb::Error& KvPair::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& KvPair::error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.KvPair.error) - return _internal_error(); -} -inline void KvPair::unsafe_arena_set_allocated_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.error_); - } - _impl_.error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.KvPair.error) -} -inline ::errorpb::Error* KvPair::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.error_; - _impl_.error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* KvPair::unsafe_arena_release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.KvPair.error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.error_; - _impl_.error_ = nullptr; - return temp; -} -inline ::errorpb::Error* KvPair::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.error_; -} -inline ::errorpb::Error* KvPair::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.KvPair.error) - return _msg; -} -inline void KvPair::set_allocated_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.KvPair.error) -} - -// bytes key = 2; -inline void KvPair::clear_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.ClearToEmpty(); -} -inline const std::string& KvPair::key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.KvPair.key) - return _internal_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void KvPair::set_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.KvPair.key) -} -inline std::string* KvPair::mutable_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.KvPair.key) - return _s; -} -inline const std::string& KvPair::_internal_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_.Get(); -} -inline void KvPair::_internal_set_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(value, GetArena()); -} -inline std::string* KvPair::_internal_mutable_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.key_.Mutable( GetArena()); -} -inline std::string* KvPair::release_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.KvPair.key) - return _impl_.key_.Release(); -} -inline void KvPair::set_allocated_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.KvPair.key) -} - -// bytes value = 3; -inline void KvPair::clear_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.ClearToEmpty(); -} -inline const std::string& KvPair::value() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.KvPair.value) - return _internal_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE void KvPair::set_value(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.KvPair.value) -} -inline std::string* KvPair::mutable_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_value(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.KvPair.value) - return _s; -} -inline const std::string& KvPair::_internal_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.value_.Get(); -} -inline void KvPair::_internal_set_value(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.Set(value, GetArena()); -} -inline std::string* KvPair::_internal_mutable_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.value_.Mutable( GetArena()); -} -inline std::string* KvPair::release_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.KvPair.value) - return _impl_.value_.Release(); -} -inline void KvPair::set_allocated_value(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.value_.IsDefault()) { - _impl_.value_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.KvPair.value) -} - -// ------------------------------------------------------------------- - -// RawGetRequest - -// .kvrpcpb.Context context = 1; -inline bool RawGetRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawGetRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawGetRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawGetRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawGetRequest.context) - return _internal_context(); -} -inline void RawGetRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawGetRequest.context) -} -inline ::kvrpcpb::Context* RawGetRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawGetRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawGetRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawGetRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawGetRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawGetRequest.context) - return _msg; -} -inline void RawGetRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawGetRequest.context) -} - -// bytes key = 2; -inline void RawGetRequest::clear_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.ClearToEmpty(); -} -inline const std::string& RawGetRequest::key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawGetRequest.key) - return _internal_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawGetRequest::set_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawGetRequest.key) -} -inline std::string* RawGetRequest::mutable_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawGetRequest.key) - return _s; -} -inline const std::string& RawGetRequest::_internal_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_.Get(); -} -inline void RawGetRequest::_internal_set_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(value, GetArena()); -} -inline std::string* RawGetRequest::_internal_mutable_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.key_.Mutable( GetArena()); -} -inline std::string* RawGetRequest::release_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawGetRequest.key) - return _impl_.key_.Release(); -} -inline void RawGetRequest::set_allocated_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawGetRequest.key) -} - -// string cf = 3; -inline void RawGetRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawGetRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawGetRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawGetRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawGetRequest.cf) -} -inline std::string* RawGetRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawGetRequest.cf) - return _s; -} -inline const std::string& RawGetRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawGetRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawGetRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawGetRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawGetRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawGetRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawGetRequest.cf) -} - -// ------------------------------------------------------------------- - -// RawGetResponse - -// .errorpb.Error region_error = 1; -inline bool RawGetResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawGetResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawGetResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawGetResponse.region_error) - return _internal_region_error(); -} -inline void RawGetResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawGetResponse.region_error) -} -inline ::errorpb::Error* RawGetResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawGetResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawGetResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawGetResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawGetResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawGetResponse.region_error) - return _msg; -} -inline void RawGetResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawGetResponse.region_error) -} - -// string error = 2; -inline void RawGetResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawGetResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawGetResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawGetResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawGetResponse.error) -} -inline std::string* RawGetResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawGetResponse.error) - return _s; -} -inline const std::string& RawGetResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawGetResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawGetResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawGetResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawGetResponse.error) - return _impl_.error_.Release(); -} -inline void RawGetResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawGetResponse.error) -} - -// bytes value = 3; -inline void RawGetResponse::clear_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.ClearToEmpty(); -} -inline const std::string& RawGetResponse::value() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawGetResponse.value) - return _internal_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawGetResponse::set_value(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawGetResponse.value) -} -inline std::string* RawGetResponse::mutable_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_value(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawGetResponse.value) - return _s; -} -inline const std::string& RawGetResponse::_internal_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.value_.Get(); -} -inline void RawGetResponse::_internal_set_value(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.Set(value, GetArena()); -} -inline std::string* RawGetResponse::_internal_mutable_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.value_.Mutable( GetArena()); -} -inline std::string* RawGetResponse::release_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawGetResponse.value) - return _impl_.value_.Release(); -} -inline void RawGetResponse::set_allocated_value(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.value_.IsDefault()) { - _impl_.value_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawGetResponse.value) -} - -// bool not_found = 4; -inline void RawGetResponse::clear_not_found() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.not_found_ = false; -} -inline bool RawGetResponse::not_found() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawGetResponse.not_found) - return _internal_not_found(); -} -inline void RawGetResponse::set_not_found(bool value) { - _internal_set_not_found(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawGetResponse.not_found) -} -inline bool RawGetResponse::_internal_not_found() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.not_found_; -} -inline void RawGetResponse::_internal_set_not_found(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.not_found_ = value; -} - -// ------------------------------------------------------------------- - -// RawBatchGetRequest - -// .kvrpcpb.Context context = 1; -inline bool RawBatchGetRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawBatchGetRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawBatchGetRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawBatchGetRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchGetRequest.context) - return _internal_context(); -} -inline void RawBatchGetRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawBatchGetRequest.context) -} -inline ::kvrpcpb::Context* RawBatchGetRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawBatchGetRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchGetRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawBatchGetRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawBatchGetRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchGetRequest.context) - return _msg; -} -inline void RawBatchGetRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchGetRequest.context) -} - -// repeated bytes keys = 2; -inline int RawBatchGetRequest::_internal_keys_size() const { - return _internal_keys().size(); -} -inline int RawBatchGetRequest::keys_size() const { - return _internal_keys_size(); -} -inline void RawBatchGetRequest::clear_keys() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.keys_.Clear(); -} -inline std::string* RawBatchGetRequest::add_keys() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - std::string* _s = _internal_mutable_keys()->Add(); - // @@protoc_insertion_point(field_add_mutable:kvrpcpb.RawBatchGetRequest.keys) - return _s; -} -inline const std::string& RawBatchGetRequest::keys(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchGetRequest.keys) - return _internal_keys().Get(index); -} -inline std::string* RawBatchGetRequest::mutable_keys(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchGetRequest.keys) - return _internal_mutable_keys()->Mutable(index); -} -inline void RawBatchGetRequest::set_keys(int index, const std::string& value) { - _internal_mutable_keys()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::set_keys(int index, std::string&& value) { - _internal_mutable_keys()->Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::set_keys(int index, const char* value) { - ABSL_DCHECK(value != nullptr); - _internal_mutable_keys()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::set_keys(int index, const void* value, - std::size_t size) { - _internal_mutable_keys()->Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::set_keys(int index, absl::string_view value) { - _internal_mutable_keys()->Mutable(index)->assign(value.data(), - value.size()); - // @@protoc_insertion_point(field_set_string_piece:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::add_keys(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign(value); - // @@protoc_insertion_point(field_add:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::add_keys(std::string&& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add(std::move(value)); - // @@protoc_insertion_point(field_add:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::add_keys(const char* value) { - ABSL_DCHECK(value != nullptr); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign(value); - // @@protoc_insertion_point(field_add_char:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::add_keys(const void* value, std::size_t size) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:kvrpcpb.RawBatchGetRequest.keys) -} -inline void RawBatchGetRequest::add_keys(absl::string_view value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign(value.data(), value.size()); - // @@protoc_insertion_point(field_add_string_piece:kvrpcpb.RawBatchGetRequest.keys) -} -inline const ::google::protobuf::RepeatedPtrField& -RawBatchGetRequest::keys() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:kvrpcpb.RawBatchGetRequest.keys) - return _internal_keys(); -} -inline ::google::protobuf::RepeatedPtrField* -RawBatchGetRequest::mutable_keys() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:kvrpcpb.RawBatchGetRequest.keys) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_keys(); -} -inline const ::google::protobuf::RepeatedPtrField& -RawBatchGetRequest::_internal_keys() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.keys_; -} -inline ::google::protobuf::RepeatedPtrField* -RawBatchGetRequest::_internal_mutable_keys() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.keys_; -} - -// string cf = 3; -inline void RawBatchGetRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawBatchGetRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchGetRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawBatchGetRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchGetRequest.cf) -} -inline std::string* RawBatchGetRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchGetRequest.cf) - return _s; -} -inline const std::string& RawBatchGetRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawBatchGetRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawBatchGetRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawBatchGetRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchGetRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawBatchGetRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchGetRequest.cf) -} - -// ------------------------------------------------------------------- - -// RawBatchGetResponse - -// .errorpb.Error region_error = 1; -inline bool RawBatchGetResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawBatchGetResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawBatchGetResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchGetResponse.region_error) - return _internal_region_error(); -} -inline void RawBatchGetResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawBatchGetResponse.region_error) -} -inline ::errorpb::Error* RawBatchGetResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawBatchGetResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchGetResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawBatchGetResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawBatchGetResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchGetResponse.region_error) - return _msg; -} -inline void RawBatchGetResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchGetResponse.region_error) -} - -// repeated .kvrpcpb.KvPair pairs = 2; -inline int RawBatchGetResponse::_internal_pairs_size() const { - return _internal_pairs().size(); -} -inline int RawBatchGetResponse::pairs_size() const { - return _internal_pairs_size(); -} -inline void RawBatchGetResponse::clear_pairs() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.pairs_.Clear(); -} -inline ::kvrpcpb::KvPair* RawBatchGetResponse::mutable_pairs(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchGetResponse.pairs) - return _internal_mutable_pairs()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* RawBatchGetResponse::mutable_pairs() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:kvrpcpb.RawBatchGetResponse.pairs) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_pairs(); -} -inline const ::kvrpcpb::KvPair& RawBatchGetResponse::pairs(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchGetResponse.pairs) - return _internal_pairs().Get(index); -} -inline ::kvrpcpb::KvPair* RawBatchGetResponse::add_pairs() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::kvrpcpb::KvPair* _add = _internal_mutable_pairs()->Add(); - // @@protoc_insertion_point(field_add:kvrpcpb.RawBatchGetResponse.pairs) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& RawBatchGetResponse::pairs() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:kvrpcpb.RawBatchGetResponse.pairs) - return _internal_pairs(); -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& -RawBatchGetResponse::_internal_pairs() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.pairs_; -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* -RawBatchGetResponse::_internal_mutable_pairs() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.pairs_; -} - -// ------------------------------------------------------------------- - -// RawPutRequest - -// .kvrpcpb.Context context = 1; -inline bool RawPutRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawPutRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawPutRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawPutRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutRequest.context) - return _internal_context(); -} -inline void RawPutRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawPutRequest.context) -} -inline ::kvrpcpb::Context* RawPutRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawPutRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawPutRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawPutRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawPutRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawPutRequest.context) - return _msg; -} -inline void RawPutRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawPutRequest.context) -} - -// bytes key = 2; -inline void RawPutRequest::clear_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.ClearToEmpty(); -} -inline const std::string& RawPutRequest::key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutRequest.key) - return _internal_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawPutRequest::set_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawPutRequest.key) -} -inline std::string* RawPutRequest::mutable_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawPutRequest.key) - return _s; -} -inline const std::string& RawPutRequest::_internal_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_.Get(); -} -inline void RawPutRequest::_internal_set_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(value, GetArena()); -} -inline std::string* RawPutRequest::_internal_mutable_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.key_.Mutable( GetArena()); -} -inline std::string* RawPutRequest::release_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawPutRequest.key) - return _impl_.key_.Release(); -} -inline void RawPutRequest::set_allocated_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawPutRequest.key) -} - -// bytes value = 3; -inline void RawPutRequest::clear_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.ClearToEmpty(); -} -inline const std::string& RawPutRequest::value() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutRequest.value) - return _internal_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawPutRequest::set_value(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawPutRequest.value) -} -inline std::string* RawPutRequest::mutable_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_value(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawPutRequest.value) - return _s; -} -inline const std::string& RawPutRequest::_internal_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.value_.Get(); -} -inline void RawPutRequest::_internal_set_value(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.Set(value, GetArena()); -} -inline std::string* RawPutRequest::_internal_mutable_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.value_.Mutable( GetArena()); -} -inline std::string* RawPutRequest::release_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawPutRequest.value) - return _impl_.value_.Release(); -} -inline void RawPutRequest::set_allocated_value(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.value_.IsDefault()) { - _impl_.value_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawPutRequest.value) -} - -// string cf = 4; -inline void RawPutRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawPutRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawPutRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawPutRequest.cf) -} -inline std::string* RawPutRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawPutRequest.cf) - return _s; -} -inline const std::string& RawPutRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawPutRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawPutRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawPutRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawPutRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawPutRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawPutRequest.cf) -} - -// uint64 ttl = 5; -inline void RawPutRequest::clear_ttl() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.ttl_ = ::uint64_t{0u}; -} -inline ::uint64_t RawPutRequest::ttl() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutRequest.ttl) - return _internal_ttl(); -} -inline void RawPutRequest::set_ttl(::uint64_t value) { - _internal_set_ttl(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawPutRequest.ttl) -} -inline ::uint64_t RawPutRequest::_internal_ttl() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.ttl_; -} -inline void RawPutRequest::_internal_set_ttl(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.ttl_ = value; -} - -// bool for_cas = 6; -inline void RawPutRequest::clear_for_cas() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.for_cas_ = false; -} -inline bool RawPutRequest::for_cas() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutRequest.for_cas) - return _internal_for_cas(); -} -inline void RawPutRequest::set_for_cas(bool value) { - _internal_set_for_cas(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawPutRequest.for_cas) -} -inline bool RawPutRequest::_internal_for_cas() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.for_cas_; -} -inline void RawPutRequest::_internal_set_for_cas(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.for_cas_ = value; -} - -// ------------------------------------------------------------------- - -// RawPutResponse - -// .errorpb.Error region_error = 1; -inline bool RawPutResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawPutResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawPutResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutResponse.region_error) - return _internal_region_error(); -} -inline void RawPutResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawPutResponse.region_error) -} -inline ::errorpb::Error* RawPutResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawPutResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawPutResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawPutResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawPutResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawPutResponse.region_error) - return _msg; -} -inline void RawPutResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawPutResponse.region_error) -} - -// string error = 2; -inline void RawPutResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawPutResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawPutResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawPutResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawPutResponse.error) -} -inline std::string* RawPutResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawPutResponse.error) - return _s; -} -inline const std::string& RawPutResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawPutResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawPutResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawPutResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawPutResponse.error) - return _impl_.error_.Release(); -} -inline void RawPutResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawPutResponse.error) -} - -// ------------------------------------------------------------------- - -// RawBatchPutRequest - -// .kvrpcpb.Context context = 1; -inline bool RawBatchPutRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawBatchPutRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawBatchPutRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawBatchPutRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchPutRequest.context) - return _internal_context(); -} -inline void RawBatchPutRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawBatchPutRequest.context) -} -inline ::kvrpcpb::Context* RawBatchPutRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawBatchPutRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchPutRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawBatchPutRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawBatchPutRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchPutRequest.context) - return _msg; -} -inline void RawBatchPutRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchPutRequest.context) -} - -// repeated .kvrpcpb.KvPair pairs = 2; -inline int RawBatchPutRequest::_internal_pairs_size() const { - return _internal_pairs().size(); -} -inline int RawBatchPutRequest::pairs_size() const { - return _internal_pairs_size(); -} -inline void RawBatchPutRequest::clear_pairs() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.pairs_.Clear(); -} -inline ::kvrpcpb::KvPair* RawBatchPutRequest::mutable_pairs(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchPutRequest.pairs) - return _internal_mutable_pairs()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* RawBatchPutRequest::mutable_pairs() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:kvrpcpb.RawBatchPutRequest.pairs) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_pairs(); -} -inline const ::kvrpcpb::KvPair& RawBatchPutRequest::pairs(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchPutRequest.pairs) - return _internal_pairs().Get(index); -} -inline ::kvrpcpb::KvPair* RawBatchPutRequest::add_pairs() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::kvrpcpb::KvPair* _add = _internal_mutable_pairs()->Add(); - // @@protoc_insertion_point(field_add:kvrpcpb.RawBatchPutRequest.pairs) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& RawBatchPutRequest::pairs() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:kvrpcpb.RawBatchPutRequest.pairs) - return _internal_pairs(); -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& -RawBatchPutRequest::_internal_pairs() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.pairs_; -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* -RawBatchPutRequest::_internal_mutable_pairs() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.pairs_; -} - -// string cf = 3; -inline void RawBatchPutRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawBatchPutRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchPutRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawBatchPutRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchPutRequest.cf) -} -inline std::string* RawBatchPutRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchPutRequest.cf) - return _s; -} -inline const std::string& RawBatchPutRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawBatchPutRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawBatchPutRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawBatchPutRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchPutRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawBatchPutRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchPutRequest.cf) -} - -// uint64 ttl = 4; -inline void RawBatchPutRequest::clear_ttl() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.ttl_ = ::uint64_t{0u}; -} -inline ::uint64_t RawBatchPutRequest::ttl() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchPutRequest.ttl) - return _internal_ttl(); -} -inline void RawBatchPutRequest::set_ttl(::uint64_t value) { - _internal_set_ttl(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchPutRequest.ttl) -} -inline ::uint64_t RawBatchPutRequest::_internal_ttl() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.ttl_; -} -inline void RawBatchPutRequest::_internal_set_ttl(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.ttl_ = value; -} - -// bool for_cas = 5; -inline void RawBatchPutRequest::clear_for_cas() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.for_cas_ = false; -} -inline bool RawBatchPutRequest::for_cas() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchPutRequest.for_cas) - return _internal_for_cas(); -} -inline void RawBatchPutRequest::set_for_cas(bool value) { - _internal_set_for_cas(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchPutRequest.for_cas) -} -inline bool RawBatchPutRequest::_internal_for_cas() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.for_cas_; -} -inline void RawBatchPutRequest::_internal_set_for_cas(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.for_cas_ = value; -} - -// ------------------------------------------------------------------- - -// RawBatchPutResponse - -// .errorpb.Error region_error = 1; -inline bool RawBatchPutResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawBatchPutResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawBatchPutResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchPutResponse.region_error) - return _internal_region_error(); -} -inline void RawBatchPutResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawBatchPutResponse.region_error) -} -inline ::errorpb::Error* RawBatchPutResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawBatchPutResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchPutResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawBatchPutResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawBatchPutResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchPutResponse.region_error) - return _msg; -} -inline void RawBatchPutResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchPutResponse.region_error) -} - -// string error = 2; -inline void RawBatchPutResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawBatchPutResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchPutResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawBatchPutResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchPutResponse.error) -} -inline std::string* RawBatchPutResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchPutResponse.error) - return _s; -} -inline const std::string& RawBatchPutResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawBatchPutResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawBatchPutResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawBatchPutResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchPutResponse.error) - return _impl_.error_.Release(); -} -inline void RawBatchPutResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchPutResponse.error) -} - -// ------------------------------------------------------------------- - -// RawDeleteRequest - -// .kvrpcpb.Context context = 1; -inline bool RawDeleteRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawDeleteRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawDeleteRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawDeleteRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRequest.context) - return _internal_context(); -} -inline void RawDeleteRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawDeleteRequest.context) -} -inline ::kvrpcpb::Context* RawDeleteRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawDeleteRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawDeleteRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawDeleteRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRequest.context) - return _msg; -} -inline void RawDeleteRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRequest.context) -} - -// bytes key = 2; -inline void RawDeleteRequest::clear_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.ClearToEmpty(); -} -inline const std::string& RawDeleteRequest::key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRequest.key) - return _internal_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawDeleteRequest::set_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteRequest.key) -} -inline std::string* RawDeleteRequest::mutable_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRequest.key) - return _s; -} -inline const std::string& RawDeleteRequest::_internal_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_.Get(); -} -inline void RawDeleteRequest::_internal_set_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(value, GetArena()); -} -inline std::string* RawDeleteRequest::_internal_mutable_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.key_.Mutable( GetArena()); -} -inline std::string* RawDeleteRequest::release_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRequest.key) - return _impl_.key_.Release(); -} -inline void RawDeleteRequest::set_allocated_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRequest.key) -} - -// string cf = 3; -inline void RawDeleteRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawDeleteRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawDeleteRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteRequest.cf) -} -inline std::string* RawDeleteRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRequest.cf) - return _s; -} -inline const std::string& RawDeleteRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawDeleteRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawDeleteRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawDeleteRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawDeleteRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRequest.cf) -} - -// bool for_cas = 4; -inline void RawDeleteRequest::clear_for_cas() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.for_cas_ = false; -} -inline bool RawDeleteRequest::for_cas() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRequest.for_cas) - return _internal_for_cas(); -} -inline void RawDeleteRequest::set_for_cas(bool value) { - _internal_set_for_cas(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteRequest.for_cas) -} -inline bool RawDeleteRequest::_internal_for_cas() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.for_cas_; -} -inline void RawDeleteRequest::_internal_set_for_cas(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.for_cas_ = value; -} - -// ------------------------------------------------------------------- - -// RawDeleteResponse - -// .errorpb.Error region_error = 1; -inline bool RawDeleteResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawDeleteResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawDeleteResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteResponse.region_error) - return _internal_region_error(); -} -inline void RawDeleteResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawDeleteResponse.region_error) -} -inline ::errorpb::Error* RawDeleteResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawDeleteResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawDeleteResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawDeleteResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteResponse.region_error) - return _msg; -} -inline void RawDeleteResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteResponse.region_error) -} - -// string error = 2; -inline void RawDeleteResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawDeleteResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawDeleteResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteResponse.error) -} -inline std::string* RawDeleteResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteResponse.error) - return _s; -} -inline const std::string& RawDeleteResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawDeleteResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawDeleteResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawDeleteResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteResponse.error) - return _impl_.error_.Release(); -} -inline void RawDeleteResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteResponse.error) -} - -// ------------------------------------------------------------------- - -// RawBatchDeleteRequest - -// .kvrpcpb.Context context = 1; -inline bool RawBatchDeleteRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawBatchDeleteRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawBatchDeleteRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawBatchDeleteRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchDeleteRequest.context) - return _internal_context(); -} -inline void RawBatchDeleteRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawBatchDeleteRequest.context) -} -inline ::kvrpcpb::Context* RawBatchDeleteRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawBatchDeleteRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchDeleteRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawBatchDeleteRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawBatchDeleteRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchDeleteRequest.context) - return _msg; -} -inline void RawBatchDeleteRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchDeleteRequest.context) -} - -// repeated bytes keys = 2; -inline int RawBatchDeleteRequest::_internal_keys_size() const { - return _internal_keys().size(); -} -inline int RawBatchDeleteRequest::keys_size() const { - return _internal_keys_size(); -} -inline void RawBatchDeleteRequest::clear_keys() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.keys_.Clear(); -} -inline std::string* RawBatchDeleteRequest::add_keys() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - std::string* _s = _internal_mutable_keys()->Add(); - // @@protoc_insertion_point(field_add_mutable:kvrpcpb.RawBatchDeleteRequest.keys) - return _s; -} -inline const std::string& RawBatchDeleteRequest::keys(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchDeleteRequest.keys) - return _internal_keys().Get(index); -} -inline std::string* RawBatchDeleteRequest::mutable_keys(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchDeleteRequest.keys) - return _internal_mutable_keys()->Mutable(index); -} -inline void RawBatchDeleteRequest::set_keys(int index, const std::string& value) { - _internal_mutable_keys()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::set_keys(int index, std::string&& value) { - _internal_mutable_keys()->Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::set_keys(int index, const char* value) { - ABSL_DCHECK(value != nullptr); - _internal_mutable_keys()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::set_keys(int index, const void* value, - std::size_t size) { - _internal_mutable_keys()->Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::set_keys(int index, absl::string_view value) { - _internal_mutable_keys()->Mutable(index)->assign(value.data(), - value.size()); - // @@protoc_insertion_point(field_set_string_piece:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::add_keys(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign(value); - // @@protoc_insertion_point(field_add:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::add_keys(std::string&& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add(std::move(value)); - // @@protoc_insertion_point(field_add:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::add_keys(const char* value) { - ABSL_DCHECK(value != nullptr); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign(value); - // @@protoc_insertion_point(field_add_char:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::add_keys(const void* value, std::size_t size) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline void RawBatchDeleteRequest::add_keys(absl::string_view value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_keys()->Add()->assign(value.data(), value.size()); - // @@protoc_insertion_point(field_add_string_piece:kvrpcpb.RawBatchDeleteRequest.keys) -} -inline const ::google::protobuf::RepeatedPtrField& -RawBatchDeleteRequest::keys() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:kvrpcpb.RawBatchDeleteRequest.keys) - return _internal_keys(); -} -inline ::google::protobuf::RepeatedPtrField* -RawBatchDeleteRequest::mutable_keys() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:kvrpcpb.RawBatchDeleteRequest.keys) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_keys(); -} -inline const ::google::protobuf::RepeatedPtrField& -RawBatchDeleteRequest::_internal_keys() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.keys_; -} -inline ::google::protobuf::RepeatedPtrField* -RawBatchDeleteRequest::_internal_mutable_keys() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.keys_; -} - -// string cf = 3; -inline void RawBatchDeleteRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawBatchDeleteRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchDeleteRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawBatchDeleteRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchDeleteRequest.cf) -} -inline std::string* RawBatchDeleteRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchDeleteRequest.cf) - return _s; -} -inline const std::string& RawBatchDeleteRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawBatchDeleteRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawBatchDeleteRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawBatchDeleteRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchDeleteRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawBatchDeleteRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchDeleteRequest.cf) -} - -// ------------------------------------------------------------------- - -// RawBatchDeleteResponse - -// .errorpb.Error region_error = 1; -inline bool RawBatchDeleteResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawBatchDeleteResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawBatchDeleteResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchDeleteResponse.region_error) - return _internal_region_error(); -} -inline void RawBatchDeleteResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawBatchDeleteResponse.region_error) -} -inline ::errorpb::Error* RawBatchDeleteResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawBatchDeleteResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchDeleteResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawBatchDeleteResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawBatchDeleteResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchDeleteResponse.region_error) - return _msg; -} -inline void RawBatchDeleteResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchDeleteResponse.region_error) -} - -// string error = 2; -inline void RawBatchDeleteResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawBatchDeleteResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawBatchDeleteResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawBatchDeleteResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawBatchDeleteResponse.error) -} -inline std::string* RawBatchDeleteResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawBatchDeleteResponse.error) - return _s; -} -inline const std::string& RawBatchDeleteResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawBatchDeleteResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawBatchDeleteResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawBatchDeleteResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawBatchDeleteResponse.error) - return _impl_.error_.Release(); -} -inline void RawBatchDeleteResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawBatchDeleteResponse.error) -} - -// ------------------------------------------------------------------- - -// RawDeleteRangeRequest - -// .kvrpcpb.Context context = 1; -inline bool RawDeleteRangeRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawDeleteRangeRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawDeleteRangeRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawDeleteRangeRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRangeRequest.context) - return _internal_context(); -} -inline void RawDeleteRangeRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawDeleteRangeRequest.context) -} -inline ::kvrpcpb::Context* RawDeleteRangeRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawDeleteRangeRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRangeRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawDeleteRangeRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawDeleteRangeRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRangeRequest.context) - return _msg; -} -inline void RawDeleteRangeRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRangeRequest.context) -} - -// bytes start_key = 2; -inline void RawDeleteRangeRequest::clear_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.ClearToEmpty(); -} -inline const std::string& RawDeleteRangeRequest::start_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRangeRequest.start_key) - return _internal_start_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawDeleteRangeRequest::set_start_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteRangeRequest.start_key) -} -inline std::string* RawDeleteRangeRequest::mutable_start_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_start_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRangeRequest.start_key) - return _s; -} -inline const std::string& RawDeleteRangeRequest::_internal_start_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.start_key_.Get(); -} -inline void RawDeleteRangeRequest::_internal_set_start_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.Set(value, GetArena()); -} -inline std::string* RawDeleteRangeRequest::_internal_mutable_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.start_key_.Mutable( GetArena()); -} -inline std::string* RawDeleteRangeRequest::release_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRangeRequest.start_key) - return _impl_.start_key_.Release(); -} -inline void RawDeleteRangeRequest::set_allocated_start_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.start_key_.IsDefault()) { - _impl_.start_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRangeRequest.start_key) -} - -// bytes end_key = 3; -inline void RawDeleteRangeRequest::clear_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.ClearToEmpty(); -} -inline const std::string& RawDeleteRangeRequest::end_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRangeRequest.end_key) - return _internal_end_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawDeleteRangeRequest::set_end_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteRangeRequest.end_key) -} -inline std::string* RawDeleteRangeRequest::mutable_end_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_end_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRangeRequest.end_key) - return _s; -} -inline const std::string& RawDeleteRangeRequest::_internal_end_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.end_key_.Get(); -} -inline void RawDeleteRangeRequest::_internal_set_end_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.Set(value, GetArena()); -} -inline std::string* RawDeleteRangeRequest::_internal_mutable_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.end_key_.Mutable( GetArena()); -} -inline std::string* RawDeleteRangeRequest::release_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRangeRequest.end_key) - return _impl_.end_key_.Release(); -} -inline void RawDeleteRangeRequest::set_allocated_end_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.end_key_.IsDefault()) { - _impl_.end_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRangeRequest.end_key) -} - -// string cf = 4; -inline void RawDeleteRangeRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawDeleteRangeRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRangeRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawDeleteRangeRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteRangeRequest.cf) -} -inline std::string* RawDeleteRangeRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRangeRequest.cf) - return _s; -} -inline const std::string& RawDeleteRangeRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawDeleteRangeRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawDeleteRangeRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawDeleteRangeRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRangeRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawDeleteRangeRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRangeRequest.cf) -} - -// ------------------------------------------------------------------- - -// RawDeleteRangeResponse - -// .errorpb.Error region_error = 1; -inline bool RawDeleteRangeResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawDeleteRangeResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawDeleteRangeResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRangeResponse.region_error) - return _internal_region_error(); -} -inline void RawDeleteRangeResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawDeleteRangeResponse.region_error) -} -inline ::errorpb::Error* RawDeleteRangeResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawDeleteRangeResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRangeResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawDeleteRangeResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawDeleteRangeResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRangeResponse.region_error) - return _msg; -} -inline void RawDeleteRangeResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRangeResponse.region_error) -} - -// string error = 2; -inline void RawDeleteRangeResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawDeleteRangeResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawDeleteRangeResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawDeleteRangeResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawDeleteRangeResponse.error) -} -inline std::string* RawDeleteRangeResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawDeleteRangeResponse.error) - return _s; -} -inline const std::string& RawDeleteRangeResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawDeleteRangeResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawDeleteRangeResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawDeleteRangeResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawDeleteRangeResponse.error) - return _impl_.error_.Release(); -} -inline void RawDeleteRangeResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawDeleteRangeResponse.error) -} - -// ------------------------------------------------------------------- - -// RawCASRequest - -// .kvrpcpb.Context context = 1; -inline bool RawCASRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawCASRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawCASRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawCASRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.context) - return _internal_context(); -} -inline void RawCASRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawCASRequest.context) -} -inline ::kvrpcpb::Context* RawCASRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawCASRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawCASRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawCASRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASRequest.context) - return _msg; -} -inline void RawCASRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASRequest.context) -} - -// bytes key = 2; -inline void RawCASRequest::clear_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.ClearToEmpty(); -} -inline const std::string& RawCASRequest::key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.key) - return _internal_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCASRequest::set_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASRequest.key) -} -inline std::string* RawCASRequest::mutable_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASRequest.key) - return _s; -} -inline const std::string& RawCASRequest::_internal_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_.Get(); -} -inline void RawCASRequest::_internal_set_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(value, GetArena()); -} -inline std::string* RawCASRequest::_internal_mutable_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.key_.Mutable( GetArena()); -} -inline std::string* RawCASRequest::release_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASRequest.key) - return _impl_.key_.Release(); -} -inline void RawCASRequest::set_allocated_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASRequest.key) -} - -// bytes value = 3; -inline void RawCASRequest::clear_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.ClearToEmpty(); -} -inline const std::string& RawCASRequest::value() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.value) - return _internal_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCASRequest::set_value(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASRequest.value) -} -inline std::string* RawCASRequest::mutable_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_value(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASRequest.value) - return _s; -} -inline const std::string& RawCASRequest::_internal_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.value_.Get(); -} -inline void RawCASRequest::_internal_set_value(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.Set(value, GetArena()); -} -inline std::string* RawCASRequest::_internal_mutable_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.value_.Mutable( GetArena()); -} -inline std::string* RawCASRequest::release_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASRequest.value) - return _impl_.value_.Release(); -} -inline void RawCASRequest::set_allocated_value(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.value_.IsDefault()) { - _impl_.value_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASRequest.value) -} - -// bool previous_not_exist = 4; -inline void RawCASRequest::clear_previous_not_exist() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.previous_not_exist_ = false; -} -inline bool RawCASRequest::previous_not_exist() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.previous_not_exist) - return _internal_previous_not_exist(); -} -inline void RawCASRequest::set_previous_not_exist(bool value) { - _internal_set_previous_not_exist(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASRequest.previous_not_exist) -} -inline bool RawCASRequest::_internal_previous_not_exist() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.previous_not_exist_; -} -inline void RawCASRequest::_internal_set_previous_not_exist(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.previous_not_exist_ = value; -} - -// bytes previous_value = 5; -inline void RawCASRequest::clear_previous_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.previous_value_.ClearToEmpty(); -} -inline const std::string& RawCASRequest::previous_value() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.previous_value) - return _internal_previous_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCASRequest::set_previous_value(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.previous_value_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASRequest.previous_value) -} -inline std::string* RawCASRequest::mutable_previous_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_previous_value(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASRequest.previous_value) - return _s; -} -inline const std::string& RawCASRequest::_internal_previous_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.previous_value_.Get(); -} -inline void RawCASRequest::_internal_set_previous_value(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.previous_value_.Set(value, GetArena()); -} -inline std::string* RawCASRequest::_internal_mutable_previous_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.previous_value_.Mutable( GetArena()); -} -inline std::string* RawCASRequest::release_previous_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASRequest.previous_value) - return _impl_.previous_value_.Release(); -} -inline void RawCASRequest::set_allocated_previous_value(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.previous_value_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.previous_value_.IsDefault()) { - _impl_.previous_value_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASRequest.previous_value) -} - -// string cf = 6; -inline void RawCASRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawCASRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCASRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASRequest.cf) -} -inline std::string* RawCASRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASRequest.cf) - return _s; -} -inline const std::string& RawCASRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawCASRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawCASRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawCASRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawCASRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASRequest.cf) -} - -// uint64 ttl = 7; -inline void RawCASRequest::clear_ttl() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.ttl_ = ::uint64_t{0u}; -} -inline ::uint64_t RawCASRequest::ttl() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.ttl) - return _internal_ttl(); -} -inline void RawCASRequest::set_ttl(::uint64_t value) { - _internal_set_ttl(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASRequest.ttl) -} -inline ::uint64_t RawCASRequest::_internal_ttl() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.ttl_; -} -inline void RawCASRequest::_internal_set_ttl(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.ttl_ = value; -} - -// bool delete = 8; -inline void RawCASRequest::clear_delete_() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.delete__ = false; -} -inline bool RawCASRequest::delete_() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASRequest.delete) - return _internal_delete_(); -} -inline void RawCASRequest::set_delete_(bool value) { - _internal_set_delete_(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASRequest.delete) -} -inline bool RawCASRequest::_internal_delete_() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.delete__; -} -inline void RawCASRequest::_internal_set_delete_(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.delete__ = value; -} - -// ------------------------------------------------------------------- - -// RawCASResponse - -// .errorpb.Error region_error = 1; -inline bool RawCASResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawCASResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawCASResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASResponse.region_error) - return _internal_region_error(); -} -inline void RawCASResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawCASResponse.region_error) -} -inline ::errorpb::Error* RawCASResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawCASResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawCASResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawCASResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASResponse.region_error) - return _msg; -} -inline void RawCASResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASResponse.region_error) -} - -// string error = 2; -inline void RawCASResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawCASResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCASResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASResponse.error) -} -inline std::string* RawCASResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASResponse.error) - return _s; -} -inline const std::string& RawCASResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawCASResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawCASResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawCASResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASResponse.error) - return _impl_.error_.Release(); -} -inline void RawCASResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASResponse.error) -} - -// bool succeed = 3; -inline void RawCASResponse::clear_succeed() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.succeed_ = false; -} -inline bool RawCASResponse::succeed() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASResponse.succeed) - return _internal_succeed(); -} -inline void RawCASResponse::set_succeed(bool value) { - _internal_set_succeed(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASResponse.succeed) -} -inline bool RawCASResponse::_internal_succeed() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.succeed_; -} -inline void RawCASResponse::_internal_set_succeed(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.succeed_ = value; -} - -// bool previous_not_exist = 4; -inline void RawCASResponse::clear_previous_not_exist() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.previous_not_exist_ = false; -} -inline bool RawCASResponse::previous_not_exist() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASResponse.previous_not_exist) - return _internal_previous_not_exist(); -} -inline void RawCASResponse::set_previous_not_exist(bool value) { - _internal_set_previous_not_exist(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASResponse.previous_not_exist) -} -inline bool RawCASResponse::_internal_previous_not_exist() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.previous_not_exist_; -} -inline void RawCASResponse::_internal_set_previous_not_exist(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.previous_not_exist_ = value; -} - -// bytes previous_value = 5; -inline void RawCASResponse::clear_previous_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.previous_value_.ClearToEmpty(); -} -inline const std::string& RawCASResponse::previous_value() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCASResponse.previous_value) - return _internal_previous_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCASResponse::set_previous_value(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.previous_value_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCASResponse.previous_value) -} -inline std::string* RawCASResponse::mutable_previous_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_previous_value(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCASResponse.previous_value) - return _s; -} -inline const std::string& RawCASResponse::_internal_previous_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.previous_value_.Get(); -} -inline void RawCASResponse::_internal_set_previous_value(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.previous_value_.Set(value, GetArena()); -} -inline std::string* RawCASResponse::_internal_mutable_previous_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.previous_value_.Mutable( GetArena()); -} -inline std::string* RawCASResponse::release_previous_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCASResponse.previous_value) - return _impl_.previous_value_.Release(); -} -inline void RawCASResponse::set_allocated_previous_value(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.previous_value_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.previous_value_.IsDefault()) { - _impl_.previous_value_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCASResponse.previous_value) -} - -// ------------------------------------------------------------------- - -// RawScanRequest - -// .kvrpcpb.Context context = 1; -inline bool RawScanRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawScanRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawScanRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawScanRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanRequest.context) - return _internal_context(); -} -inline void RawScanRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawScanRequest.context) -} -inline ::kvrpcpb::Context* RawScanRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawScanRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawScanRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawScanRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawScanRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawScanRequest.context) - return _msg; -} -inline void RawScanRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawScanRequest.context) -} - -// bytes start_key = 2; -inline void RawScanRequest::clear_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.ClearToEmpty(); -} -inline const std::string& RawScanRequest::start_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanRequest.start_key) - return _internal_start_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawScanRequest::set_start_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawScanRequest.start_key) -} -inline std::string* RawScanRequest::mutable_start_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_start_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawScanRequest.start_key) - return _s; -} -inline const std::string& RawScanRequest::_internal_start_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.start_key_.Get(); -} -inline void RawScanRequest::_internal_set_start_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.Set(value, GetArena()); -} -inline std::string* RawScanRequest::_internal_mutable_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.start_key_.Mutable( GetArena()); -} -inline std::string* RawScanRequest::release_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawScanRequest.start_key) - return _impl_.start_key_.Release(); -} -inline void RawScanRequest::set_allocated_start_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.start_key_.IsDefault()) { - _impl_.start_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawScanRequest.start_key) -} - -// uint32 limit = 3; -inline void RawScanRequest::clear_limit() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.limit_ = 0u; -} -inline ::uint32_t RawScanRequest::limit() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanRequest.limit) - return _internal_limit(); -} -inline void RawScanRequest::set_limit(::uint32_t value) { - _internal_set_limit(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawScanRequest.limit) -} -inline ::uint32_t RawScanRequest::_internal_limit() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.limit_; -} -inline void RawScanRequest::_internal_set_limit(::uint32_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.limit_ = value; -} - -// bool key_only = 4; -inline void RawScanRequest::clear_key_only() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_only_ = false; -} -inline bool RawScanRequest::key_only() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanRequest.key_only) - return _internal_key_only(); -} -inline void RawScanRequest::set_key_only(bool value) { - _internal_set_key_only(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawScanRequest.key_only) -} -inline bool RawScanRequest::_internal_key_only() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_only_; -} -inline void RawScanRequest::_internal_set_key_only(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_only_ = value; -} - -// string cf = 5; -inline void RawScanRequest::clear_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.ClearToEmpty(); -} -inline const std::string& RawScanRequest::cf() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanRequest.cf) - return _internal_cf(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawScanRequest::set_cf(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawScanRequest.cf) -} -inline std::string* RawScanRequest::mutable_cf() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_cf(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawScanRequest.cf) - return _s; -} -inline const std::string& RawScanRequest::_internal_cf() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cf_.Get(); -} -inline void RawScanRequest::_internal_set_cf(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cf_.Set(value, GetArena()); -} -inline std::string* RawScanRequest::_internal_mutable_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.cf_.Mutable( GetArena()); -} -inline std::string* RawScanRequest::release_cf() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawScanRequest.cf) - return _impl_.cf_.Release(); -} -inline void RawScanRequest::set_allocated_cf(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cf_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.cf_.IsDefault()) { - _impl_.cf_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawScanRequest.cf) -} - -// bool reverse = 6; -inline void RawScanRequest::clear_reverse() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.reverse_ = false; -} -inline bool RawScanRequest::reverse() const { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanRequest.reverse) - return _internal_reverse(); -} -inline void RawScanRequest::set_reverse(bool value) { - _internal_set_reverse(value); - // @@protoc_insertion_point(field_set:kvrpcpb.RawScanRequest.reverse) -} -inline bool RawScanRequest::_internal_reverse() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.reverse_; -} -inline void RawScanRequest::_internal_set_reverse(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.reverse_ = value; -} - -// bytes end_key = 7; -inline void RawScanRequest::clear_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.ClearToEmpty(); -} -inline const std::string& RawScanRequest::end_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanRequest.end_key) - return _internal_end_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawScanRequest::set_end_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawScanRequest.end_key) -} -inline std::string* RawScanRequest::mutable_end_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_end_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawScanRequest.end_key) - return _s; -} -inline const std::string& RawScanRequest::_internal_end_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.end_key_.Get(); -} -inline void RawScanRequest::_internal_set_end_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.Set(value, GetArena()); -} -inline std::string* RawScanRequest::_internal_mutable_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.end_key_.Mutable( GetArena()); -} -inline std::string* RawScanRequest::release_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawScanRequest.end_key) - return _impl_.end_key_.Release(); -} -inline void RawScanRequest::set_allocated_end_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.end_key_.IsDefault()) { - _impl_.end_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawScanRequest.end_key) -} - -// ------------------------------------------------------------------- - -// RawScanResponse - -// .errorpb.Error region_error = 1; -inline bool RawScanResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawScanResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawScanResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanResponse.region_error) - return _internal_region_error(); -} -inline void RawScanResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawScanResponse.region_error) -} -inline ::errorpb::Error* RawScanResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawScanResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawScanResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawScanResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawScanResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawScanResponse.region_error) - return _msg; -} -inline void RawScanResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawScanResponse.region_error) -} - -// repeated .kvrpcpb.KvPair kvs = 2; -inline int RawScanResponse::_internal_kvs_size() const { - return _internal_kvs().size(); -} -inline int RawScanResponse::kvs_size() const { - return _internal_kvs_size(); -} -inline void RawScanResponse::clear_kvs() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.kvs_.Clear(); -} -inline ::kvrpcpb::KvPair* RawScanResponse::mutable_kvs(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawScanResponse.kvs) - return _internal_mutable_kvs()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* RawScanResponse::mutable_kvs() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:kvrpcpb.RawScanResponse.kvs) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_kvs(); -} -inline const ::kvrpcpb::KvPair& RawScanResponse::kvs(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawScanResponse.kvs) - return _internal_kvs().Get(index); -} -inline ::kvrpcpb::KvPair* RawScanResponse::add_kvs() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::kvrpcpb::KvPair* _add = _internal_mutable_kvs()->Add(); - // @@protoc_insertion_point(field_add:kvrpcpb.RawScanResponse.kvs) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& RawScanResponse::kvs() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:kvrpcpb.RawScanResponse.kvs) - return _internal_kvs(); -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>& -RawScanResponse::_internal_kvs() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.kvs_; -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KvPair>* -RawScanResponse::_internal_mutable_kvs() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.kvs_; -} - -// ------------------------------------------------------------------- - -// KeyRange - -// bytes start_key = 1; -inline void KeyRange::clear_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.ClearToEmpty(); -} -inline const std::string& KeyRange::start_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.KeyRange.start_key) - return _internal_start_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void KeyRange::set_start_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.KeyRange.start_key) -} -inline std::string* KeyRange::mutable_start_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_start_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.KeyRange.start_key) - return _s; -} -inline const std::string& KeyRange::_internal_start_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.start_key_.Get(); -} -inline void KeyRange::_internal_set_start_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.Set(value, GetArena()); -} -inline std::string* KeyRange::_internal_mutable_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.start_key_.Mutable( GetArena()); -} -inline std::string* KeyRange::release_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.KeyRange.start_key) - return _impl_.start_key_.Release(); -} -inline void KeyRange::set_allocated_start_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.start_key_.IsDefault()) { - _impl_.start_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.KeyRange.start_key) -} - -// bytes end_key = 2; -inline void KeyRange::clear_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.ClearToEmpty(); -} -inline const std::string& KeyRange::end_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.KeyRange.end_key) - return _internal_end_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void KeyRange::set_end_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.KeyRange.end_key) -} -inline std::string* KeyRange::mutable_end_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_end_key(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.KeyRange.end_key) - return _s; -} -inline const std::string& KeyRange::_internal_end_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.end_key_.Get(); -} -inline void KeyRange::_internal_set_end_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.Set(value, GetArena()); -} -inline std::string* KeyRange::_internal_mutable_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.end_key_.Mutable( GetArena()); -} -inline std::string* KeyRange::release_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.KeyRange.end_key) - return _impl_.end_key_.Release(); -} -inline void KeyRange::set_allocated_end_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.end_key_.IsDefault()) { - _impl_.end_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.KeyRange.end_key) -} - -// ------------------------------------------------------------------- - -// RawCoprocessorRequest - -// .kvrpcpb.Context context = 1; -inline bool RawCoprocessorRequest::has_context() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.context_ != nullptr); - return value; -} -inline void RawCoprocessorRequest::clear_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.context_ != nullptr) _impl_.context_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::kvrpcpb::Context& RawCoprocessorRequest::_internal_context() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::kvrpcpb::Context* p = _impl_.context_; - return p != nullptr ? *p : reinterpret_cast(::kvrpcpb::_Context_default_instance_); -} -inline const ::kvrpcpb::Context& RawCoprocessorRequest::context() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorRequest.context) - return _internal_context(); -} -inline void RawCoprocessorRequest::unsafe_arena_set_allocated_context(::kvrpcpb::Context* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.context_); - } - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawCoprocessorRequest.context) -} -inline ::kvrpcpb::Context* RawCoprocessorRequest::release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* released = _impl_.context_; - _impl_.context_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::kvrpcpb::Context* RawCoprocessorRequest::unsafe_arena_release_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCoprocessorRequest.context) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::kvrpcpb::Context* temp = _impl_.context_; - _impl_.context_ = nullptr; - return temp; -} -inline ::kvrpcpb::Context* RawCoprocessorRequest::_internal_mutable_context() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.context_ == nullptr) { - auto* p = CreateMaybeMessage<::kvrpcpb::Context>(GetArena()); - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(p); - } - return _impl_.context_; -} -inline ::kvrpcpb::Context* RawCoprocessorRequest::mutable_context() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::kvrpcpb::Context* _msg = _internal_mutable_context(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorRequest.context) - return _msg; -} -inline void RawCoprocessorRequest::set_allocated_context(::kvrpcpb::Context* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::kvrpcpb::Context*>(_impl_.context_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::kvrpcpb::Context*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.context_ = reinterpret_cast<::kvrpcpb::Context*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCoprocessorRequest.context) -} - -// string copr_name = 2; -inline void RawCoprocessorRequest::clear_copr_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.copr_name_.ClearToEmpty(); -} -inline const std::string& RawCoprocessorRequest::copr_name() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorRequest.copr_name) - return _internal_copr_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCoprocessorRequest::set_copr_name(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.copr_name_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCoprocessorRequest.copr_name) -} -inline std::string* RawCoprocessorRequest::mutable_copr_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_copr_name(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorRequest.copr_name) - return _s; -} -inline const std::string& RawCoprocessorRequest::_internal_copr_name() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.copr_name_.Get(); -} -inline void RawCoprocessorRequest::_internal_set_copr_name(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.copr_name_.Set(value, GetArena()); -} -inline std::string* RawCoprocessorRequest::_internal_mutable_copr_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.copr_name_.Mutable( GetArena()); -} -inline std::string* RawCoprocessorRequest::release_copr_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCoprocessorRequest.copr_name) - return _impl_.copr_name_.Release(); -} -inline void RawCoprocessorRequest::set_allocated_copr_name(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.copr_name_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.copr_name_.IsDefault()) { - _impl_.copr_name_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCoprocessorRequest.copr_name) -} - -// string copr_version_req = 3; -inline void RawCoprocessorRequest::clear_copr_version_req() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.copr_version_req_.ClearToEmpty(); -} -inline const std::string& RawCoprocessorRequest::copr_version_req() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorRequest.copr_version_req) - return _internal_copr_version_req(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCoprocessorRequest::set_copr_version_req(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.copr_version_req_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCoprocessorRequest.copr_version_req) -} -inline std::string* RawCoprocessorRequest::mutable_copr_version_req() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_copr_version_req(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorRequest.copr_version_req) - return _s; -} -inline const std::string& RawCoprocessorRequest::_internal_copr_version_req() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.copr_version_req_.Get(); -} -inline void RawCoprocessorRequest::_internal_set_copr_version_req(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.copr_version_req_.Set(value, GetArena()); -} -inline std::string* RawCoprocessorRequest::_internal_mutable_copr_version_req() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.copr_version_req_.Mutable( GetArena()); -} -inline std::string* RawCoprocessorRequest::release_copr_version_req() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCoprocessorRequest.copr_version_req) - return _impl_.copr_version_req_.Release(); -} -inline void RawCoprocessorRequest::set_allocated_copr_version_req(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.copr_version_req_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.copr_version_req_.IsDefault()) { - _impl_.copr_version_req_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCoprocessorRequest.copr_version_req) -} - -// repeated .kvrpcpb.KeyRange ranges = 4; -inline int RawCoprocessorRequest::_internal_ranges_size() const { - return _internal_ranges().size(); -} -inline int RawCoprocessorRequest::ranges_size() const { - return _internal_ranges_size(); -} -inline void RawCoprocessorRequest::clear_ranges() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.ranges_.Clear(); -} -inline ::kvrpcpb::KeyRange* RawCoprocessorRequest::mutable_ranges(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorRequest.ranges) - return _internal_mutable_ranges()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KeyRange>* RawCoprocessorRequest::mutable_ranges() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:kvrpcpb.RawCoprocessorRequest.ranges) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_ranges(); -} -inline const ::kvrpcpb::KeyRange& RawCoprocessorRequest::ranges(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorRequest.ranges) - return _internal_ranges().Get(index); -} -inline ::kvrpcpb::KeyRange* RawCoprocessorRequest::add_ranges() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::kvrpcpb::KeyRange* _add = _internal_mutable_ranges()->Add(); - // @@protoc_insertion_point(field_add:kvrpcpb.RawCoprocessorRequest.ranges) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KeyRange>& RawCoprocessorRequest::ranges() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:kvrpcpb.RawCoprocessorRequest.ranges) - return _internal_ranges(); -} -inline const ::google::protobuf::RepeatedPtrField<::kvrpcpb::KeyRange>& -RawCoprocessorRequest::_internal_ranges() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.ranges_; -} -inline ::google::protobuf::RepeatedPtrField<::kvrpcpb::KeyRange>* -RawCoprocessorRequest::_internal_mutable_ranges() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.ranges_; -} - -// bytes data = 5; -inline void RawCoprocessorRequest::clear_data() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.data_.ClearToEmpty(); -} -inline const std::string& RawCoprocessorRequest::data() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorRequest.data) - return _internal_data(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCoprocessorRequest::set_data(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.data_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCoprocessorRequest.data) -} -inline std::string* RawCoprocessorRequest::mutable_data() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_data(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorRequest.data) - return _s; -} -inline const std::string& RawCoprocessorRequest::_internal_data() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.data_.Get(); -} -inline void RawCoprocessorRequest::_internal_set_data(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.data_.Set(value, GetArena()); -} -inline std::string* RawCoprocessorRequest::_internal_mutable_data() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.data_.Mutable( GetArena()); -} -inline std::string* RawCoprocessorRequest::release_data() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCoprocessorRequest.data) - return _impl_.data_.Release(); -} -inline void RawCoprocessorRequest::set_allocated_data(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.data_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.data_.IsDefault()) { - _impl_.data_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCoprocessorRequest.data) -} - -// ------------------------------------------------------------------- - -// RawCoprocessorResponse - -// .errorpb.Error region_error = 1; -inline bool RawCoprocessorResponse::has_region_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_error_ != nullptr); - return value; -} -inline const ::errorpb::Error& RawCoprocessorResponse::_internal_region_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::errorpb::Error* p = _impl_.region_error_; - return p != nullptr ? *p : reinterpret_cast(::errorpb::_Error_default_instance_); -} -inline const ::errorpb::Error& RawCoprocessorResponse::region_error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorResponse.region_error) - return _internal_region_error(); -} -inline void RawCoprocessorResponse::unsafe_arena_set_allocated_region_error(::errorpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:kvrpcpb.RawCoprocessorResponse.region_error) -} -inline ::errorpb::Error* RawCoprocessorResponse::release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* released = _impl_.region_error_; - _impl_.region_error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::errorpb::Error* RawCoprocessorResponse::unsafe_arena_release_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCoprocessorResponse.region_error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::errorpb::Error* temp = _impl_.region_error_; - _impl_.region_error_ = nullptr; - return temp; -} -inline ::errorpb::Error* RawCoprocessorResponse::_internal_mutable_region_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_error_ == nullptr) { - auto* p = CreateMaybeMessage<::errorpb::Error>(GetArena()); - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(p); - } - return _impl_.region_error_; -} -inline ::errorpb::Error* RawCoprocessorResponse::mutable_region_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::errorpb::Error* _msg = _internal_mutable_region_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorResponse.region_error) - return _msg; -} -inline void RawCoprocessorResponse::set_allocated_region_error(::errorpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_error_ = reinterpret_cast<::errorpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCoprocessorResponse.region_error) -} - -// string error = 2; -inline void RawCoprocessorResponse::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.ClearToEmpty(); -} -inline const std::string& RawCoprocessorResponse::error() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorResponse.error) - return _internal_error(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCoprocessorResponse::set_error(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCoprocessorResponse.error) -} -inline std::string* RawCoprocessorResponse::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorResponse.error) - return _s; -} -inline const std::string& RawCoprocessorResponse::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.error_.Get(); -} -inline void RawCoprocessorResponse::_internal_set_error(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.error_.Set(value, GetArena()); -} -inline std::string* RawCoprocessorResponse::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.error_.Mutable( GetArena()); -} -inline std::string* RawCoprocessorResponse::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCoprocessorResponse.error) - return _impl_.error_.Release(); -} -inline void RawCoprocessorResponse::set_allocated_error(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.error_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCoprocessorResponse.error) -} - -// bytes data = 3; -inline void RawCoprocessorResponse::clear_data() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.data_.ClearToEmpty(); -} -inline const std::string& RawCoprocessorResponse::data() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:kvrpcpb.RawCoprocessorResponse.data) - return _internal_data(); -} -template -inline PROTOBUF_ALWAYS_INLINE void RawCoprocessorResponse::set_data(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.data_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:kvrpcpb.RawCoprocessorResponse.data) -} -inline std::string* RawCoprocessorResponse::mutable_data() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_data(); - // @@protoc_insertion_point(field_mutable:kvrpcpb.RawCoprocessorResponse.data) - return _s; -} -inline const std::string& RawCoprocessorResponse::_internal_data() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.data_.Get(); -} -inline void RawCoprocessorResponse::_internal_set_data(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.data_.Set(value, GetArena()); -} -inline std::string* RawCoprocessorResponse::_internal_mutable_data() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.data_.Mutable( GetArena()); -} -inline std::string* RawCoprocessorResponse::release_data() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:kvrpcpb.RawCoprocessorResponse.data) - return _impl_.data_.Release(); -} -inline void RawCoprocessorResponse::set_allocated_data(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.data_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.data_.IsDefault()) { - _impl_.data_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:kvrpcpb.RawCoprocessorResponse.data) -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) -} // namespace kvrpcpb - - -namespace google { -namespace protobuf { - -template <> -struct is_proto_enum<::kvrpcpb::CommandPri> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::kvrpcpb::CommandPri>() { - return ::kvrpcpb::CommandPri_descriptor(); -} -template <> -struct is_proto_enum<::kvrpcpb::IsolationLevel> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::kvrpcpb::IsolationLevel>() { - return ::kvrpcpb::IsolationLevel_descriptor(); -} - -} // namespace protobuf -} // namespace google - -// @@protoc_insertion_point(global_scope) - -#include "google/protobuf/port_undef.inc" - -#endif // GOOGLE_PROTOBUF_INCLUDED_kvrpcpb_2eproto_2epb_2eh diff --git a/ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.cc b/ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.cc deleted file mode 100644 index 2baa18417..000000000 --- a/ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: metapb.proto - -#include "metapb.pb.h" -#include "metapb.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace metapb { - -} // namespace metapb - diff --git a/ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.h b/ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.h deleted file mode 100644 index 8f5c48cbe..000000000 --- a/ThirdParty/kvproto/generated/kvproto/metapb.grpc.pb.h +++ /dev/null @@ -1,37 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: metapb.proto -// Original file comments: -// Extracted from https://github.com/pingcap/kvproto -// Minimal definitions needed for SPANN TiKV integration. -// -#ifndef GRPC_metapb_2eproto__INCLUDED -#define GRPC_metapb_2eproto__INCLUDED - -#include "metapb.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace metapb { - -} // namespace metapb - - -#endif // GRPC_metapb_2eproto__INCLUDED diff --git a/ThirdParty/kvproto/generated/kvproto/metapb.pb.cc b/ThirdParty/kvproto/generated/kvproto/metapb.pb.cc deleted file mode 100644 index 0e8be0b3e..000000000 --- a/ThirdParty/kvproto/generated/kvproto/metapb.pb.cc +++ /dev/null @@ -1,2082 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: metapb.proto - -#include "metapb.pb.h" - -#include -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/extension_set.h" -#include "google/protobuf/wire_format_lite.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/reflection_ops.h" -#include "google/protobuf/wire_format.h" -#include "google/protobuf/generated_message_tctable_impl.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" -PROTOBUF_PRAGMA_INIT_SEG -namespace _pb = ::google::protobuf; -namespace _pbi = ::google::protobuf::internal; -namespace _fl = ::google::protobuf::internal::field_layout; -namespace metapb { - -inline constexpr StoreLabel::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - value_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR StoreLabel::StoreLabel(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct StoreLabelDefaultTypeInternal { - PROTOBUF_CONSTEXPR StoreLabelDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~StoreLabelDefaultTypeInternal() {} - union { - StoreLabel _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StoreLabelDefaultTypeInternal _StoreLabel_default_instance_; - -inline constexpr RegionEpoch::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : conf_ver_{::uint64_t{0u}}, - version_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR RegionEpoch::RegionEpoch(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RegionEpochDefaultTypeInternal { - PROTOBUF_CONSTEXPR RegionEpochDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RegionEpochDefaultTypeInternal() {} - union { - RegionEpoch _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionEpochDefaultTypeInternal _RegionEpoch_default_instance_; - -inline constexpr Peer::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : id_{::uint64_t{0u}}, - store_id_{::uint64_t{0u}}, - role_{static_cast< ::metapb::PeerRole >(0)}, - is_witness_{false}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR Peer::Peer(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct PeerDefaultTypeInternal { - PROTOBUF_CONSTEXPR PeerDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~PeerDefaultTypeInternal() {} - union { - Peer _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PeerDefaultTypeInternal _Peer_default_instance_; - -inline constexpr Cluster::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : id_{::uint64_t{0u}}, - max_peer_count_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR Cluster::Cluster(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct ClusterDefaultTypeInternal { - PROTOBUF_CONSTEXPR ClusterDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~ClusterDefaultTypeInternal() {} - union { - Cluster _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ClusterDefaultTypeInternal _Cluster_default_instance_; - -inline constexpr Store::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : labels_{}, - address_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - version_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - status_address_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - git_hash_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - deploy_path_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - peer_address_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - id_{::uint64_t{0u}}, - physically_destroyed_{::int64_t{0}}, - state_{static_cast< ::metapb::StoreState >(0)}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR Store::Store(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct StoreDefaultTypeInternal { - PROTOBUF_CONSTEXPR StoreDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~StoreDefaultTypeInternal() {} - union { - Store _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StoreDefaultTypeInternal _Store_default_instance_; - -inline constexpr Region::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - peers_{}, - start_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - end_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - encryption_meta_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - region_epoch_{nullptr}, - id_{::uint64_t{0u}}, - is_in_flashback_{false} {} - -template -PROTOBUF_CONSTEXPR Region::Region(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RegionDefaultTypeInternal { - PROTOBUF_CONSTEXPR RegionDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RegionDefaultTypeInternal() {} - union { - Region _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionDefaultTypeInternal _Region_default_instance_; -} // namespace metapb -static ::_pb::Metadata file_level_metadata_metapb_2eproto[6]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_metapb_2eproto[2]; -static constexpr const ::_pb::ServiceDescriptor** - file_level_service_descriptors_metapb_2eproto = nullptr; -const ::uint32_t TableStruct_metapb_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( - protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::metapb::Cluster, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::metapb::Cluster, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::metapb::Cluster, _impl_.max_peer_count_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::metapb::Store, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.address_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.state_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.labels_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.version_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.status_address_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.git_hash_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.deploy_path_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.physically_destroyed_), - PROTOBUF_FIELD_OFFSET(::metapb::Store, _impl_.peer_address_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::metapb::StoreLabel, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::metapb::StoreLabel, _impl_.key_), - PROTOBUF_FIELD_OFFSET(::metapb::StoreLabel, _impl_.value_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_.start_key_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_.end_key_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_.region_epoch_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_.peers_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_.encryption_meta_), - PROTOBUF_FIELD_OFFSET(::metapb::Region, _impl_.is_in_flashback_), - ~0u, - ~0u, - ~0u, - 0, - ~0u, - ~0u, - ~0u, - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::metapb::RegionEpoch, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::metapb::RegionEpoch, _impl_.conf_ver_), - PROTOBUF_FIELD_OFFSET(::metapb::RegionEpoch, _impl_.version_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::metapb::Peer, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::metapb::Peer, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::metapb::Peer, _impl_.store_id_), - PROTOBUF_FIELD_OFFSET(::metapb::Peer, _impl_.role_), - PROTOBUF_FIELD_OFFSET(::metapb::Peer, _impl_.is_witness_), -}; - -static const ::_pbi::MigrationSchema - schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::metapb::Cluster)}, - {10, -1, -1, sizeof(::metapb::Store)}, - {28, -1, -1, sizeof(::metapb::StoreLabel)}, - {38, 53, -1, sizeof(::metapb::Region)}, - {60, -1, -1, sizeof(::metapb::RegionEpoch)}, - {70, -1, -1, sizeof(::metapb::Peer)}, -}; - -static const ::_pb::Message* const file_default_instances[] = { - &::metapb::_Cluster_default_instance_._instance, - &::metapb::_Store_default_instance_._instance, - &::metapb::_StoreLabel_default_instance_._instance, - &::metapb::_Region_default_instance_._instance, - &::metapb::_RegionEpoch_default_instance_._instance, - &::metapb::_Peer_default_instance_._instance, -}; -const char descriptor_table_protodef_metapb_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\014metapb.proto\022\006metapb\"-\n\007Cluster\022\n\n\002id\030" - "\001 \001(\004\022\026\n\016max_peer_count\030\002 \001(\004\"\357\001\n\005Store\022" - "\n\n\002id\030\001 \001(\004\022\017\n\007address\030\002 \001(\t\022!\n\005state\030\003 " - "\001(\0162\022.metapb.StoreState\022\"\n\006labels\030\004 \003(\0132" - "\022.metapb.StoreLabel\022\017\n\007version\030\005 \001(\t\022\026\n\016" - "status_address\030\006 \001(\t\022\020\n\010git_hash\030\007 \001(\t\022\023" - "\n\013deploy_path\030\010 \001(\t\022\034\n\024physically_destro" - "yed\030\t \001(\003\022\024\n\014peer_address\030\n \001(\t\"(\n\nStore" - "Label\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"\262\001\n\006Re" - "gion\022\n\n\002id\030\001 \001(\004\022\021\n\tstart_key\030\002 \001(\014\022\017\n\007e" - "nd_key\030\003 \001(\014\022)\n\014region_epoch\030\004 \001(\0132\023.met" - "apb.RegionEpoch\022\033\n\005peers\030\005 \003(\0132\014.metapb." - "Peer\022\027\n\017encryption_meta\030\006 \001(\014\022\027\n\017is_in_f" - "lashback\030\007 \001(\010\"0\n\013RegionEpoch\022\020\n\010conf_ve" - "r\030\001 \001(\004\022\017\n\007version\030\002 \001(\004\"X\n\004Peer\022\n\n\002id\030\001" - " \001(\004\022\020\n\010store_id\030\002 \001(\004\022\036\n\004role\030\003 \001(\0162\020.m" - "etapb.PeerRole\022\022\n\nis_witness\030\004 \001(\010*0\n\nSt" - "oreState\022\006\n\002Up\020\000\022\013\n\007Offline\020\001\022\r\n\tTombsto" - "ne\020\002*H\n\010PeerRole\022\t\n\005Voter\020\000\022\013\n\007Learner\020\001" - "\022\021\n\rIncomingVoter\020\002\022\021\n\rDemotingVoter\020\003B\022" - "\n\020org.tikv.kvprotob\006proto3" -}; -static ::absl::once_flag descriptor_table_metapb_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_metapb_2eproto = { - false, - false, - 826, - descriptor_table_protodef_metapb_2eproto, - "metapb.proto", - &descriptor_table_metapb_2eproto_once, - nullptr, - 0, - 6, - schemas, - file_default_instances, - TableStruct_metapb_2eproto::offsets, - file_level_metadata_metapb_2eproto, - file_level_enum_descriptors_metapb_2eproto, - file_level_service_descriptors_metapb_2eproto, -}; - -// This function exists to be marked as weak. -// It can significantly speed up compilation by breaking up LLVM's SCC -// in the .pb.cc translation units. Large translation units see a -// reduction of more than 35% of walltime for optimized builds. Without -// the weak attribute all the messages in the file, including all the -// vtables and everything they use become part of the same SCC through -// a cycle like: -// GetMetadata -> descriptor table -> default instances -> -// vtables -> GetMetadata -// By adding a weak function here we break the connection from the -// individual vtables back into the descriptor table. -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_metapb_2eproto_getter() { - return &descriptor_table_metapb_2eproto; -} -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 -static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_metapb_2eproto(&descriptor_table_metapb_2eproto); -namespace metapb { -const ::google::protobuf::EnumDescriptor* StoreState_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_metapb_2eproto); - return file_level_enum_descriptors_metapb_2eproto[0]; -} -PROTOBUF_CONSTINIT const uint32_t StoreState_internal_data_[] = { - 196608u, 0u, }; -bool StoreState_IsValid(int value) { - return 0 <= value && value <= 2; -} -const ::google::protobuf::EnumDescriptor* PeerRole_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_metapb_2eproto); - return file_level_enum_descriptors_metapb_2eproto[1]; -} -PROTOBUF_CONSTINIT const uint32_t PeerRole_internal_data_[] = { - 262144u, 0u, }; -bool PeerRole_IsValid(int value) { - return 0 <= value && value <= 3; -} -// =================================================================== - -class Cluster::_Internal { - public: -}; - -Cluster::Cluster(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:metapb.Cluster) -} -Cluster::Cluster( - ::google::protobuf::Arena* arena, const Cluster& from) - : Cluster(arena) { - MergeFrom(from); -} -inline PROTOBUF_NDEBUG_INLINE Cluster::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void Cluster::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, id_), - 0, - offsetof(Impl_, max_peer_count_) - - offsetof(Impl_, id_) + - sizeof(Impl_::max_peer_count_)); -} -Cluster::~Cluster() { - // @@protoc_insertion_point(destructor:metapb.Cluster) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Cluster::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Cluster::Clear() { -// @@protoc_insertion_point(message_clear_start:metapb.Cluster) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&_impl_.id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.max_peer_count_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.max_peer_count_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Cluster::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 0, 2> Cluster::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_Cluster_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 max_peer_count = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Cluster, _impl_.max_peer_count_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Cluster, _impl_.max_peer_count_)}}, - // uint64 id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Cluster, _impl_.id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Cluster, _impl_.id_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 id = 1; - {PROTOBUF_FIELD_OFFSET(Cluster, _impl_.id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // uint64 max_peer_count = 2; - {PROTOBUF_FIELD_OFFSET(Cluster, _impl_.max_peer_count_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* Cluster::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:metapb.Cluster) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 id = 1; - if (this->_internal_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_id(), target); - } - - // uint64 max_peer_count = 2; - if (this->_internal_max_peer_count() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_max_peer_count(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:metapb.Cluster) - return target; -} - -::size_t Cluster::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:metapb.Cluster) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 id = 1; - if (this->_internal_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_id()); - } - - // uint64 max_peer_count = 2; - if (this->_internal_max_peer_count() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_max_peer_count()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Cluster::_class_data_ = { - Cluster::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Cluster::GetClassData() const { - return &_class_data_; -} - -void Cluster::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:metapb.Cluster) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_id() != 0) { - _this->_internal_set_id(from._internal_id()); - } - if (from._internal_max_peer_count() != 0) { - _this->_internal_set_max_peer_count(from._internal_max_peer_count()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Cluster::CopyFrom(const Cluster& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:metapb.Cluster) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Cluster::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Cluster::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Cluster::InternalSwap(Cluster* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Cluster, _impl_.max_peer_count_) - + sizeof(Cluster::_impl_.max_peer_count_) - - PROTOBUF_FIELD_OFFSET(Cluster, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); -} - -::google::protobuf::Metadata Cluster::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_metapb_2eproto_getter, &descriptor_table_metapb_2eproto_once, - file_level_metadata_metapb_2eproto[0]); -} -// =================================================================== - -class Store::_Internal { - public: -}; - -Store::Store(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:metapb.Store) -} -inline PROTOBUF_NDEBUG_INLINE Store::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : labels_{visibility, arena, from.labels_}, - address_(arena, from.address_), - version_(arena, from.version_), - status_address_(arena, from.status_address_), - git_hash_(arena, from.git_hash_), - deploy_path_(arena, from.deploy_path_), - peer_address_(arena, from.peer_address_), - _cached_size_{0} {} - -Store::Store( - ::google::protobuf::Arena* arena, - const Store& from) - : ::google::protobuf::Message(arena) { - Store* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, id_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, id_), - offsetof(Impl_, state_) - - offsetof(Impl_, id_) + - sizeof(Impl_::state_)); - - // @@protoc_insertion_point(copy_constructor:metapb.Store) -} -inline PROTOBUF_NDEBUG_INLINE Store::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : labels_{visibility, arena}, - address_(arena), - version_(arena), - status_address_(arena), - git_hash_(arena), - deploy_path_(arena), - peer_address_(arena), - _cached_size_{0} {} - -inline void Store::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, id_), - 0, - offsetof(Impl_, state_) - - offsetof(Impl_, id_) + - sizeof(Impl_::state_)); -} -Store::~Store() { - // @@protoc_insertion_point(destructor:metapb.Store) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Store::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.address_.Destroy(); - _impl_.version_.Destroy(); - _impl_.status_address_.Destroy(); - _impl_.git_hash_.Destroy(); - _impl_.deploy_path_.Destroy(); - _impl_.peer_address_.Destroy(); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Store::Clear() { -// @@protoc_insertion_point(message_clear_start:metapb.Store) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.labels_.Clear(); - _impl_.address_.ClearToEmpty(); - _impl_.version_.ClearToEmpty(); - _impl_.status_address_.ClearToEmpty(); - _impl_.git_hash_.ClearToEmpty(); - _impl_.deploy_path_.ClearToEmpty(); - _impl_.peer_address_.ClearToEmpty(); - ::memset(&_impl_.id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.state_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.state_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Store::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<4, 10, 1, 88, 2> Store::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 10, 120, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294966272, // skipmap - offsetof(decltype(_table_), field_entries), - 10, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_Store_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // uint64 id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Store, _impl_.id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.id_)}}, - // string address = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.address_)}}, - // .metapb.StoreState state = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Store, _impl_.state_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.state_)}}, - // repeated .metapb.StoreLabel labels = 4; - {::_pbi::TcParser::FastMtR1, - {34, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.labels_)}}, - // string version = 5; - {::_pbi::TcParser::FastUS1, - {42, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.version_)}}, - // string status_address = 6; - {::_pbi::TcParser::FastUS1, - {50, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.status_address_)}}, - // string git_hash = 7; - {::_pbi::TcParser::FastUS1, - {58, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.git_hash_)}}, - // string deploy_path = 8; - {::_pbi::TcParser::FastUS1, - {66, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.deploy_path_)}}, - // int64 physically_destroyed = 9; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Store, _impl_.physically_destroyed_), 63>(), - {72, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.physically_destroyed_)}}, - // string peer_address = 10; - {::_pbi::TcParser::FastUS1, - {82, 63, 0, PROTOBUF_FIELD_OFFSET(Store, _impl_.peer_address_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 id = 1; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // string address = 2; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.address_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // .metapb.StoreState state = 3; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.state_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // repeated .metapb.StoreLabel labels = 4; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.labels_), 0, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // string version = 5; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.version_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // string status_address = 6; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.status_address_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // string git_hash = 7; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.git_hash_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // string deploy_path = 8; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.deploy_path_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // int64 physically_destroyed = 9; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.physically_destroyed_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kInt64)}, - // string peer_address = 10; - {PROTOBUF_FIELD_OFFSET(Store, _impl_.peer_address_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::metapb::StoreLabel>()}, - }}, {{ - "\14\0\7\0\0\7\16\10\13\0\14\0\0\0\0\0" - "metapb.Store" - "address" - "version" - "status_address" - "git_hash" - "deploy_path" - "peer_address" - }}, -}; - -::uint8_t* Store::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:metapb.Store) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 id = 1; - if (this->_internal_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_id(), target); - } - - // string address = 2; - if (!this->_internal_address().empty()) { - const std::string& _s = this->_internal_address(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.Store.address"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - // .metapb.StoreState state = 3; - if (this->_internal_state() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 3, this->_internal_state(), target); - } - - // repeated .metapb.StoreLabel labels = 4; - for (unsigned i = 0, - n = static_cast(this->_internal_labels_size()); i < n; i++) { - const auto& repfield = this->_internal_labels().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); - } - - // string version = 5; - if (!this->_internal_version().empty()) { - const std::string& _s = this->_internal_version(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.Store.version"); - target = stream->WriteStringMaybeAliased(5, _s, target); - } - - // string status_address = 6; - if (!this->_internal_status_address().empty()) { - const std::string& _s = this->_internal_status_address(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.Store.status_address"); - target = stream->WriteStringMaybeAliased(6, _s, target); - } - - // string git_hash = 7; - if (!this->_internal_git_hash().empty()) { - const std::string& _s = this->_internal_git_hash(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.Store.git_hash"); - target = stream->WriteStringMaybeAliased(7, _s, target); - } - - // string deploy_path = 8; - if (!this->_internal_deploy_path().empty()) { - const std::string& _s = this->_internal_deploy_path(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.Store.deploy_path"); - target = stream->WriteStringMaybeAliased(8, _s, target); - } - - // int64 physically_destroyed = 9; - if (this->_internal_physically_destroyed() != 0) { - target = ::google::protobuf::internal::WireFormatLite:: - WriteInt64ToArrayWithField<9>( - stream, this->_internal_physically_destroyed(), target); - } - - // string peer_address = 10; - if (!this->_internal_peer_address().empty()) { - const std::string& _s = this->_internal_peer_address(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.Store.peer_address"); - target = stream->WriteStringMaybeAliased(10, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:metapb.Store) - return target; -} - -::size_t Store::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:metapb.Store) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .metapb.StoreLabel labels = 4; - total_size += 1UL * this->_internal_labels_size(); - for (const auto& msg : this->_internal_labels()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - // string address = 2; - if (!this->_internal_address().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_address()); - } - - // string version = 5; - if (!this->_internal_version().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_version()); - } - - // string status_address = 6; - if (!this->_internal_status_address().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_status_address()); - } - - // string git_hash = 7; - if (!this->_internal_git_hash().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_git_hash()); - } - - // string deploy_path = 8; - if (!this->_internal_deploy_path().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_deploy_path()); - } - - // string peer_address = 10; - if (!this->_internal_peer_address().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_peer_address()); - } - - // uint64 id = 1; - if (this->_internal_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_id()); - } - - // int64 physically_destroyed = 9; - if (this->_internal_physically_destroyed() != 0) { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne( - this->_internal_physically_destroyed()); - } - - // .metapb.StoreState state = 3; - if (this->_internal_state() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_state()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Store::_class_data_ = { - Store::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Store::GetClassData() const { - return &_class_data_; -} - -void Store::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:metapb.Store) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_labels()->MergeFrom( - from._internal_labels()); - if (!from._internal_address().empty()) { - _this->_internal_set_address(from._internal_address()); - } - if (!from._internal_version().empty()) { - _this->_internal_set_version(from._internal_version()); - } - if (!from._internal_status_address().empty()) { - _this->_internal_set_status_address(from._internal_status_address()); - } - if (!from._internal_git_hash().empty()) { - _this->_internal_set_git_hash(from._internal_git_hash()); - } - if (!from._internal_deploy_path().empty()) { - _this->_internal_set_deploy_path(from._internal_deploy_path()); - } - if (!from._internal_peer_address().empty()) { - _this->_internal_set_peer_address(from._internal_peer_address()); - } - if (from._internal_id() != 0) { - _this->_internal_set_id(from._internal_id()); - } - if (from._internal_physically_destroyed() != 0) { - _this->_internal_set_physically_destroyed(from._internal_physically_destroyed()); - } - if (from._internal_state() != 0) { - _this->_internal_set_state(from._internal_state()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Store::CopyFrom(const Store& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:metapb.Store) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Store::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Store::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Store::InternalSwap(Store* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.labels_.InternalSwap(&other->_impl_.labels_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.address_, &other->_impl_.address_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.version_, &other->_impl_.version_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.status_address_, &other->_impl_.status_address_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.git_hash_, &other->_impl_.git_hash_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.deploy_path_, &other->_impl_.deploy_path_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.peer_address_, &other->_impl_.peer_address_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Store, _impl_.state_) - + sizeof(Store::_impl_.state_) - - PROTOBUF_FIELD_OFFSET(Store, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); -} - -::google::protobuf::Metadata Store::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_metapb_2eproto_getter, &descriptor_table_metapb_2eproto_once, - file_level_metadata_metapb_2eproto[1]); -} -// =================================================================== - -class StoreLabel::_Internal { - public: -}; - -StoreLabel::StoreLabel(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:metapb.StoreLabel) -} -inline PROTOBUF_NDEBUG_INLINE StoreLabel::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : key_(arena, from.key_), - value_(arena, from.value_), - _cached_size_{0} {} - -StoreLabel::StoreLabel( - ::google::protobuf::Arena* arena, - const StoreLabel& from) - : ::google::protobuf::Message(arena) { - StoreLabel* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - - // @@protoc_insertion_point(copy_constructor:metapb.StoreLabel) -} -inline PROTOBUF_NDEBUG_INLINE StoreLabel::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : key_(arena), - value_(arena), - _cached_size_{0} {} - -inline void StoreLabel::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); -} -StoreLabel::~StoreLabel() { - // @@protoc_insertion_point(destructor:metapb.StoreLabel) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void StoreLabel::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.key_.Destroy(); - _impl_.value_.Destroy(); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void StoreLabel::Clear() { -// @@protoc_insertion_point(message_clear_start:metapb.StoreLabel) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.key_.ClearToEmpty(); - _impl_.value_.ClearToEmpty(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* StoreLabel::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 34, 2> StoreLabel::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_StoreLabel_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string value = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(StoreLabel, _impl_.value_)}}, - // string key = 1; - {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(StoreLabel, _impl_.key_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // string key = 1; - {PROTOBUF_FIELD_OFFSET(StoreLabel, _impl_.key_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // string value = 2; - {PROTOBUF_FIELD_OFFSET(StoreLabel, _impl_.value_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, - // no aux_entries - {{ - "\21\3\5\0\0\0\0\0" - "metapb.StoreLabel" - "key" - "value" - }}, -}; - -::uint8_t* StoreLabel::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:metapb.StoreLabel) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // string key = 1; - if (!this->_internal_key().empty()) { - const std::string& _s = this->_internal_key(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.StoreLabel.key"); - target = stream->WriteStringMaybeAliased(1, _s, target); - } - - // string value = 2; - if (!this->_internal_value().empty()) { - const std::string& _s = this->_internal_value(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "metapb.StoreLabel.value"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:metapb.StoreLabel) - return target; -} - -::size_t StoreLabel::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:metapb.StoreLabel) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string key = 1; - if (!this->_internal_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_key()); - } - - // string value = 2; - if (!this->_internal_value().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_value()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData StoreLabel::_class_data_ = { - StoreLabel::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* StoreLabel::GetClassData() const { - return &_class_data_; -} - -void StoreLabel::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:metapb.StoreLabel) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_key().empty()) { - _this->_internal_set_key(from._internal_key()); - } - if (!from._internal_value().empty()) { - _this->_internal_set_value(from._internal_value()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void StoreLabel::CopyFrom(const StoreLabel& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:metapb.StoreLabel) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool StoreLabel::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* StoreLabel::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void StoreLabel::InternalSwap(StoreLabel* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.value_, &other->_impl_.value_, arena); -} - -::google::protobuf::Metadata StoreLabel::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_metapb_2eproto_getter, &descriptor_table_metapb_2eproto_once, - file_level_metadata_metapb_2eproto[2]); -} -// =================================================================== - -class Region::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(Region, _impl_._has_bits_); - static const ::metapb::RegionEpoch& region_epoch(const Region* msg); - static void set_has_region_epoch(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::metapb::RegionEpoch& Region::_Internal::region_epoch(const Region* msg) { - return *msg->_impl_.region_epoch_; -} -Region::Region(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:metapb.Region) -} -inline PROTOBUF_NDEBUG_INLINE Region::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - peers_{visibility, arena, from.peers_}, - start_key_(arena, from.start_key_), - end_key_(arena, from.end_key_), - encryption_meta_(arena, from.encryption_meta_) {} - -Region::Region( - ::google::protobuf::Arena* arena, - const Region& from) - : ::google::protobuf::Message(arena) { - Region* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.region_epoch_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::metapb::RegionEpoch>(arena, *from._impl_.region_epoch_) - : nullptr; - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, id_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, id_), - offsetof(Impl_, is_in_flashback_) - - offsetof(Impl_, id_) + - sizeof(Impl_::is_in_flashback_)); - - // @@protoc_insertion_point(copy_constructor:metapb.Region) -} -inline PROTOBUF_NDEBUG_INLINE Region::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - peers_{visibility, arena}, - start_key_(arena), - end_key_(arena), - encryption_meta_(arena) {} - -inline void Region::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, region_epoch_), - 0, - offsetof(Impl_, is_in_flashback_) - - offsetof(Impl_, region_epoch_) + - sizeof(Impl_::is_in_flashback_)); -} -Region::~Region() { - // @@protoc_insertion_point(destructor:metapb.Region) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Region::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.start_key_.Destroy(); - _impl_.end_key_.Destroy(); - _impl_.encryption_meta_.Destroy(); - delete _impl_.region_epoch_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Region::Clear() { -// @@protoc_insertion_point(message_clear_start:metapb.Region) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.peers_.Clear(); - _impl_.start_key_.ClearToEmpty(); - _impl_.end_key_.ClearToEmpty(); - _impl_.encryption_meta_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.region_epoch_ != nullptr); - _impl_.region_epoch_->Clear(); - } - ::memset(&_impl_.id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.is_in_flashback_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.is_in_flashback_)); - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Region::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 7, 2, 0, 2> Region::_table_ = { - { - PROTOBUF_FIELD_OFFSET(Region, _impl_._has_bits_), - 0, // no _extensions_ - 7, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967168, // skipmap - offsetof(decltype(_table_), field_entries), - 7, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_Region_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // uint64 id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Region, _impl_.id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Region, _impl_.id_)}}, - // bytes start_key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(Region, _impl_.start_key_)}}, - // bytes end_key = 3; - {::_pbi::TcParser::FastBS1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(Region, _impl_.end_key_)}}, - // .metapb.RegionEpoch region_epoch = 4; - {::_pbi::TcParser::FastMtS1, - {34, 0, 0, PROTOBUF_FIELD_OFFSET(Region, _impl_.region_epoch_)}}, - // repeated .metapb.Peer peers = 5; - {::_pbi::TcParser::FastMtR1, - {42, 63, 1, PROTOBUF_FIELD_OFFSET(Region, _impl_.peers_)}}, - // bytes encryption_meta = 6; - {::_pbi::TcParser::FastBS1, - {50, 63, 0, PROTOBUF_FIELD_OFFSET(Region, _impl_.encryption_meta_)}}, - // bool is_in_flashback = 7; - {::_pbi::TcParser::SingularVarintNoZag1(), - {56, 63, 0, PROTOBUF_FIELD_OFFSET(Region, _impl_.is_in_flashback_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 id = 1; - {PROTOBUF_FIELD_OFFSET(Region, _impl_.id_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // bytes start_key = 2; - {PROTOBUF_FIELD_OFFSET(Region, _impl_.start_key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bytes end_key = 3; - {PROTOBUF_FIELD_OFFSET(Region, _impl_.end_key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // .metapb.RegionEpoch region_epoch = 4; - {PROTOBUF_FIELD_OFFSET(Region, _impl_.region_epoch_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated .metapb.Peer peers = 5; - {PROTOBUF_FIELD_OFFSET(Region, _impl_.peers_), -1, 1, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes encryption_meta = 6; - {PROTOBUF_FIELD_OFFSET(Region, _impl_.encryption_meta_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - // bool is_in_flashback = 7; - {PROTOBUF_FIELD_OFFSET(Region, _impl_.is_in_flashback_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, {{ - {::_pbi::TcParser::GetTable<::metapb::RegionEpoch>()}, - {::_pbi::TcParser::GetTable<::metapb::Peer>()}, - }}, {{ - }}, -}; - -::uint8_t* Region::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:metapb.Region) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 id = 1; - if (this->_internal_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_id(), target); - } - - // bytes start_key = 2; - if (!this->_internal_start_key().empty()) { - const std::string& _s = this->_internal_start_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - // bytes end_key = 3; - if (!this->_internal_end_key().empty()) { - const std::string& _s = this->_internal_end_key(); - target = stream->WriteBytesMaybeAliased(3, _s, target); - } - - cached_has_bits = _impl_._has_bits_[0]; - // .metapb.RegionEpoch region_epoch = 4; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 4, _Internal::region_epoch(this), - _Internal::region_epoch(this).GetCachedSize(), target, stream); - } - - // repeated .metapb.Peer peers = 5; - for (unsigned i = 0, - n = static_cast(this->_internal_peers_size()); i < n; i++) { - const auto& repfield = this->_internal_peers().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream); - } - - // bytes encryption_meta = 6; - if (!this->_internal_encryption_meta().empty()) { - const std::string& _s = this->_internal_encryption_meta(); - target = stream->WriteBytesMaybeAliased(6, _s, target); - } - - // bool is_in_flashback = 7; - if (this->_internal_is_in_flashback() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 7, this->_internal_is_in_flashback(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:metapb.Region) - return target; -} - -::size_t Region::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:metapb.Region) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .metapb.Peer peers = 5; - total_size += 1UL * this->_internal_peers_size(); - for (const auto& msg : this->_internal_peers()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - // bytes start_key = 2; - if (!this->_internal_start_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_start_key()); - } - - // bytes end_key = 3; - if (!this->_internal_end_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_end_key()); - } - - // bytes encryption_meta = 6; - if (!this->_internal_encryption_meta().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_encryption_meta()); - } - - // .metapb.RegionEpoch region_epoch = 4; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_epoch_); - } - - // uint64 id = 1; - if (this->_internal_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_id()); - } - - // bool is_in_flashback = 7; - if (this->_internal_is_in_flashback() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Region::_class_data_ = { - Region::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Region::GetClassData() const { - return &_class_data_; -} - -void Region::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:metapb.Region) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_peers()->MergeFrom( - from._internal_peers()); - if (!from._internal_start_key().empty()) { - _this->_internal_set_start_key(from._internal_start_key()); - } - if (!from._internal_end_key().empty()) { - _this->_internal_set_end_key(from._internal_end_key()); - } - if (!from._internal_encryption_meta().empty()) { - _this->_internal_set_encryption_meta(from._internal_encryption_meta()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_region_epoch()->::metapb::RegionEpoch::MergeFrom( - from._internal_region_epoch()); - } - if (from._internal_id() != 0) { - _this->_internal_set_id(from._internal_id()); - } - if (from._internal_is_in_flashback() != 0) { - _this->_internal_set_is_in_flashback(from._internal_is_in_flashback()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Region::CopyFrom(const Region& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:metapb.Region) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Region::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Region::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Region::InternalSwap(Region* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.peers_.InternalSwap(&other->_impl_.peers_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.start_key_, &other->_impl_.start_key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.end_key_, &other->_impl_.end_key_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.encryption_meta_, &other->_impl_.encryption_meta_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Region, _impl_.is_in_flashback_) - + sizeof(Region::_impl_.is_in_flashback_) - - PROTOBUF_FIELD_OFFSET(Region, _impl_.region_epoch_)>( - reinterpret_cast(&_impl_.region_epoch_), - reinterpret_cast(&other->_impl_.region_epoch_)); -} - -::google::protobuf::Metadata Region::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_metapb_2eproto_getter, &descriptor_table_metapb_2eproto_once, - file_level_metadata_metapb_2eproto[3]); -} -// =================================================================== - -class RegionEpoch::_Internal { - public: -}; - -RegionEpoch::RegionEpoch(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:metapb.RegionEpoch) -} -RegionEpoch::RegionEpoch( - ::google::protobuf::Arena* arena, const RegionEpoch& from) - : RegionEpoch(arena) { - MergeFrom(from); -} -inline PROTOBUF_NDEBUG_INLINE RegionEpoch::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void RegionEpoch::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, conf_ver_), - 0, - offsetof(Impl_, version_) - - offsetof(Impl_, conf_ver_) + - sizeof(Impl_::version_)); -} -RegionEpoch::~RegionEpoch() { - // @@protoc_insertion_point(destructor:metapb.RegionEpoch) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RegionEpoch::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RegionEpoch::Clear() { -// @@protoc_insertion_point(message_clear_start:metapb.RegionEpoch) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&_impl_.conf_ver_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.version_) - - reinterpret_cast(&_impl_.conf_ver_)) + sizeof(_impl_.version_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RegionEpoch::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 0, 2> RegionEpoch::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_RegionEpoch_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 version = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RegionEpoch, _impl_.version_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(RegionEpoch, _impl_.version_)}}, - // uint64 conf_ver = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RegionEpoch, _impl_.conf_ver_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(RegionEpoch, _impl_.conf_ver_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 conf_ver = 1; - {PROTOBUF_FIELD_OFFSET(RegionEpoch, _impl_.conf_ver_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // uint64 version = 2; - {PROTOBUF_FIELD_OFFSET(RegionEpoch, _impl_.version_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* RegionEpoch::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:metapb.RegionEpoch) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 conf_ver = 1; - if (this->_internal_conf_ver() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_conf_ver(), target); - } - - // uint64 version = 2; - if (this->_internal_version() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_version(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:metapb.RegionEpoch) - return target; -} - -::size_t RegionEpoch::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:metapb.RegionEpoch) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 conf_ver = 1; - if (this->_internal_conf_ver() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_conf_ver()); - } - - // uint64 version = 2; - if (this->_internal_version() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_version()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RegionEpoch::_class_data_ = { - RegionEpoch::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RegionEpoch::GetClassData() const { - return &_class_data_; -} - -void RegionEpoch::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:metapb.RegionEpoch) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_conf_ver() != 0) { - _this->_internal_set_conf_ver(from._internal_conf_ver()); - } - if (from._internal_version() != 0) { - _this->_internal_set_version(from._internal_version()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RegionEpoch::CopyFrom(const RegionEpoch& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:metapb.RegionEpoch) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RegionEpoch::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RegionEpoch::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RegionEpoch::InternalSwap(RegionEpoch* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RegionEpoch, _impl_.version_) - + sizeof(RegionEpoch::_impl_.version_) - - PROTOBUF_FIELD_OFFSET(RegionEpoch, _impl_.conf_ver_)>( - reinterpret_cast(&_impl_.conf_ver_), - reinterpret_cast(&other->_impl_.conf_ver_)); -} - -::google::protobuf::Metadata RegionEpoch::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_metapb_2eproto_getter, &descriptor_table_metapb_2eproto_once, - file_level_metadata_metapb_2eproto[4]); -} -// =================================================================== - -class Peer::_Internal { - public: -}; - -Peer::Peer(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:metapb.Peer) -} -Peer::Peer( - ::google::protobuf::Arena* arena, const Peer& from) - : Peer(arena) { - MergeFrom(from); -} -inline PROTOBUF_NDEBUG_INLINE Peer::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void Peer::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, id_), - 0, - offsetof(Impl_, is_witness_) - - offsetof(Impl_, id_) + - sizeof(Impl_::is_witness_)); -} -Peer::~Peer() { - // @@protoc_insertion_point(destructor:metapb.Peer) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Peer::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Peer::Clear() { -// @@protoc_insertion_point(message_clear_start:metapb.Peer) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&_impl_.id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.is_witness_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.is_witness_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Peer::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 0, 0, 2> Peer::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap - offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_Peer_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bool is_witness = 4; - {::_pbi::TcParser::SingularVarintNoZag1(), - {32, 63, 0, PROTOBUF_FIELD_OFFSET(Peer, _impl_.is_witness_)}}, - // uint64 id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Peer, _impl_.id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Peer, _impl_.id_)}}, - // uint64 store_id = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Peer, _impl_.store_id_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Peer, _impl_.store_id_)}}, - // .metapb.PeerRole role = 3; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Peer, _impl_.role_), 63>(), - {24, 63, 0, PROTOBUF_FIELD_OFFSET(Peer, _impl_.role_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 id = 1; - {PROTOBUF_FIELD_OFFSET(Peer, _impl_.id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // uint64 store_id = 2; - {PROTOBUF_FIELD_OFFSET(Peer, _impl_.store_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // .metapb.PeerRole role = 3; - {PROTOBUF_FIELD_OFFSET(Peer, _impl_.role_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // bool is_witness = 4; - {PROTOBUF_FIELD_OFFSET(Peer, _impl_.is_witness_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBool)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* Peer::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:metapb.Peer) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 id = 1; - if (this->_internal_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_id(), target); - } - - // uint64 store_id = 2; - if (this->_internal_store_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_store_id(), target); - } - - // .metapb.PeerRole role = 3; - if (this->_internal_role() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 3, this->_internal_role(), target); - } - - // bool is_witness = 4; - if (this->_internal_is_witness() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray( - 4, this->_internal_is_witness(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:metapb.Peer) - return target; -} - -::size_t Peer::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:metapb.Peer) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 id = 1; - if (this->_internal_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_id()); - } - - // uint64 store_id = 2; - if (this->_internal_store_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_store_id()); - } - - // .metapb.PeerRole role = 3; - if (this->_internal_role() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_role()); - } - - // bool is_witness = 4; - if (this->_internal_is_witness() != 0) { - total_size += 2; - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Peer::_class_data_ = { - Peer::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Peer::GetClassData() const { - return &_class_data_; -} - -void Peer::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:metapb.Peer) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_id() != 0) { - _this->_internal_set_id(from._internal_id()); - } - if (from._internal_store_id() != 0) { - _this->_internal_set_store_id(from._internal_store_id()); - } - if (from._internal_role() != 0) { - _this->_internal_set_role(from._internal_role()); - } - if (from._internal_is_witness() != 0) { - _this->_internal_set_is_witness(from._internal_is_witness()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Peer::CopyFrom(const Peer& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:metapb.Peer) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Peer::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Peer::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Peer::InternalSwap(Peer* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Peer, _impl_.is_witness_) - + sizeof(Peer::_impl_.is_witness_) - - PROTOBUF_FIELD_OFFSET(Peer, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); -} - -::google::protobuf::Metadata Peer::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_metapb_2eproto_getter, &descriptor_table_metapb_2eproto_once, - file_level_metadata_metapb_2eproto[5]); -} -// @@protoc_insertion_point(namespace_scope) -} // namespace metapb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google -// @@protoc_insertion_point(global_scope) -#include "google/protobuf/port_undef.inc" diff --git a/ThirdParty/kvproto/generated/kvproto/metapb.pb.h b/ThirdParty/kvproto/generated/kvproto/metapb.pb.h deleted file mode 100644 index 5ff7617c8..000000000 --- a/ThirdParty/kvproto/generated/kvproto/metapb.pb.h +++ /dev/null @@ -1,2693 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: metapb.proto -// Protobuf C++ Version: 4.25.3 - -#ifndef GOOGLE_PROTOBUF_INCLUDED_metapb_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_metapb_2eproto_2epb_2eh - -#include -#include -#include -#include - -#include "google/protobuf/port_def.inc" -#if PROTOBUF_VERSION < 4025000 -#error "This file was generated by a newer version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please update" -#error "your headers." -#endif // PROTOBUF_VERSION - -#if 4025003 < PROTOBUF_MIN_PROTOC_VERSION -#error "This file was generated by an older version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please" -#error "regenerate this file with a newer version of protoc." -#endif // PROTOBUF_MIN_PROTOC_VERSION -#include "google/protobuf/port_undef.inc" -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/arena.h" -#include "google/protobuf/arenastring.h" -#include "google/protobuf/generated_message_tctable_decl.h" -#include "google/protobuf/generated_message_util.h" -#include "google/protobuf/metadata_lite.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/message.h" -#include "google/protobuf/repeated_field.h" // IWYU pragma: export -#include "google/protobuf/extension_set.h" // IWYU pragma: export -#include "google/protobuf/generated_enum_reflection.h" -#include "google/protobuf/unknown_field_set.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" - -#define PROTOBUF_INTERNAL_EXPORT_metapb_2eproto - -namespace google { -namespace protobuf { -namespace internal { -class AnyMetadata; -} // namespace internal -} // namespace protobuf -} // namespace google - -// Internal implementation detail -- do not use these members. -struct TableStruct_metapb_2eproto { - static const ::uint32_t offsets[]; -}; -extern const ::google::protobuf::internal::DescriptorTable - descriptor_table_metapb_2eproto; -namespace metapb { -class Cluster; -struct ClusterDefaultTypeInternal; -extern ClusterDefaultTypeInternal _Cluster_default_instance_; -class Peer; -struct PeerDefaultTypeInternal; -extern PeerDefaultTypeInternal _Peer_default_instance_; -class Region; -struct RegionDefaultTypeInternal; -extern RegionDefaultTypeInternal _Region_default_instance_; -class RegionEpoch; -struct RegionEpochDefaultTypeInternal; -extern RegionEpochDefaultTypeInternal _RegionEpoch_default_instance_; -class Store; -struct StoreDefaultTypeInternal; -extern StoreDefaultTypeInternal _Store_default_instance_; -class StoreLabel; -struct StoreLabelDefaultTypeInternal; -extern StoreLabelDefaultTypeInternal _StoreLabel_default_instance_; -} // namespace metapb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google - -namespace metapb { -enum StoreState : int { - Up = 0, - Offline = 1, - Tombstone = 2, - StoreState_INT_MIN_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::min(), - StoreState_INT_MAX_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::max(), -}; - -bool StoreState_IsValid(int value); -extern const uint32_t StoreState_internal_data_[]; -constexpr StoreState StoreState_MIN = static_cast(0); -constexpr StoreState StoreState_MAX = static_cast(2); -constexpr int StoreState_ARRAYSIZE = 2 + 1; -const ::google::protobuf::EnumDescriptor* -StoreState_descriptor(); -template -const std::string& StoreState_Name(T value) { - static_assert(std::is_same::value || - std::is_integral::value, - "Incorrect type passed to StoreState_Name()."); - return StoreState_Name(static_cast(value)); -} -template <> -inline const std::string& StoreState_Name(StoreState value) { - return ::google::protobuf::internal::NameOfDenseEnum( - static_cast(value)); -} -inline bool StoreState_Parse(absl::string_view name, StoreState* value) { - return ::google::protobuf::internal::ParseNamedEnum( - StoreState_descriptor(), name, value); -} -enum PeerRole : int { - Voter = 0, - Learner = 1, - IncomingVoter = 2, - DemotingVoter = 3, - PeerRole_INT_MIN_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::min(), - PeerRole_INT_MAX_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::max(), -}; - -bool PeerRole_IsValid(int value); -extern const uint32_t PeerRole_internal_data_[]; -constexpr PeerRole PeerRole_MIN = static_cast(0); -constexpr PeerRole PeerRole_MAX = static_cast(3); -constexpr int PeerRole_ARRAYSIZE = 3 + 1; -const ::google::protobuf::EnumDescriptor* -PeerRole_descriptor(); -template -const std::string& PeerRole_Name(T value) { - static_assert(std::is_same::value || - std::is_integral::value, - "Incorrect type passed to PeerRole_Name()."); - return PeerRole_Name(static_cast(value)); -} -template <> -inline const std::string& PeerRole_Name(PeerRole value) { - return ::google::protobuf::internal::NameOfDenseEnum( - static_cast(value)); -} -inline bool PeerRole_Parse(absl::string_view name, PeerRole* value) { - return ::google::protobuf::internal::ParseNamedEnum( - PeerRole_descriptor(), name, value); -} - -// =================================================================== - - -// ------------------------------------------------------------------- - -class StoreLabel final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:metapb.StoreLabel) */ { - public: - inline StoreLabel() : StoreLabel(nullptr) {} - ~StoreLabel() override; - template - explicit PROTOBUF_CONSTEXPR StoreLabel(::google::protobuf::internal::ConstantInitialized); - - inline StoreLabel(const StoreLabel& from) - : StoreLabel(nullptr, from) {} - StoreLabel(StoreLabel&& from) noexcept - : StoreLabel() { - *this = ::std::move(from); - } - - inline StoreLabel& operator=(const StoreLabel& from) { - CopyFrom(from); - return *this; - } - inline StoreLabel& operator=(StoreLabel&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const StoreLabel& default_instance() { - return *internal_default_instance(); - } - static inline const StoreLabel* internal_default_instance() { - return reinterpret_cast( - &_StoreLabel_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(StoreLabel& a, StoreLabel& b) { - a.Swap(&b); - } - inline void Swap(StoreLabel* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StoreLabel* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - StoreLabel* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const StoreLabel& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const StoreLabel& from) { - StoreLabel::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(StoreLabel* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "metapb.StoreLabel"; - } - protected: - explicit StoreLabel(::google::protobuf::Arena* arena); - StoreLabel(::google::protobuf::Arena* arena, const StoreLabel& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 1, - kValueFieldNumber = 2, - }; - // string key = 1; - void clear_key() ; - const std::string& key() const; - template - void set_key(Arg_&& arg, Args_... args); - std::string* mutable_key(); - PROTOBUF_NODISCARD std::string* release_key(); - void set_allocated_key(std::string* value); - - private: - const std::string& _internal_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_key( - const std::string& value); - std::string* _internal_mutable_key(); - - public: - // string value = 2; - void clear_value() ; - const std::string& value() const; - template - void set_value(Arg_&& arg, Args_... args); - std::string* mutable_value(); - PROTOBUF_NODISCARD std::string* release_value(); - void set_allocated_value(std::string* value); - - private: - const std::string& _internal_value() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_value( - const std::string& value); - std::string* _internal_mutable_value(); - - public: - // @@protoc_insertion_point(class_scope:metapb.StoreLabel) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 34, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::ArenaStringPtr key_; - ::google::protobuf::internal::ArenaStringPtr value_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_metapb_2eproto; -};// ------------------------------------------------------------------- - -class RegionEpoch final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:metapb.RegionEpoch) */ { - public: - inline RegionEpoch() : RegionEpoch(nullptr) {} - ~RegionEpoch() override; - template - explicit PROTOBUF_CONSTEXPR RegionEpoch(::google::protobuf::internal::ConstantInitialized); - - inline RegionEpoch(const RegionEpoch& from) - : RegionEpoch(nullptr, from) {} - RegionEpoch(RegionEpoch&& from) noexcept - : RegionEpoch() { - *this = ::std::move(from); - } - - inline RegionEpoch& operator=(const RegionEpoch& from) { - CopyFrom(from); - return *this; - } - inline RegionEpoch& operator=(RegionEpoch&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RegionEpoch& default_instance() { - return *internal_default_instance(); - } - static inline const RegionEpoch* internal_default_instance() { - return reinterpret_cast( - &_RegionEpoch_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(RegionEpoch& a, RegionEpoch& b) { - a.Swap(&b); - } - inline void Swap(RegionEpoch* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RegionEpoch* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RegionEpoch* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RegionEpoch& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RegionEpoch& from) { - RegionEpoch::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RegionEpoch* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "metapb.RegionEpoch"; - } - protected: - explicit RegionEpoch(::google::protobuf::Arena* arena); - RegionEpoch(::google::protobuf::Arena* arena, const RegionEpoch& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kConfVerFieldNumber = 1, - kVersionFieldNumber = 2, - }; - // uint64 conf_ver = 1; - void clear_conf_ver() ; - ::uint64_t conf_ver() const; - void set_conf_ver(::uint64_t value); - - private: - ::uint64_t _internal_conf_ver() const; - void _internal_set_conf_ver(::uint64_t value); - - public: - // uint64 version = 2; - void clear_version() ; - ::uint64_t version() const; - void set_version(::uint64_t value); - - private: - ::uint64_t _internal_version() const; - void _internal_set_version(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:metapb.RegionEpoch) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::uint64_t conf_ver_; - ::uint64_t version_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_metapb_2eproto; -};// ------------------------------------------------------------------- - -class Peer final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:metapb.Peer) */ { - public: - inline Peer() : Peer(nullptr) {} - ~Peer() override; - template - explicit PROTOBUF_CONSTEXPR Peer(::google::protobuf::internal::ConstantInitialized); - - inline Peer(const Peer& from) - : Peer(nullptr, from) {} - Peer(Peer&& from) noexcept - : Peer() { - *this = ::std::move(from); - } - - inline Peer& operator=(const Peer& from) { - CopyFrom(from); - return *this; - } - inline Peer& operator=(Peer&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Peer& default_instance() { - return *internal_default_instance(); - } - static inline const Peer* internal_default_instance() { - return reinterpret_cast( - &_Peer_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(Peer& a, Peer& b) { - a.Swap(&b); - } - inline void Swap(Peer* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Peer* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Peer* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Peer& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Peer& from) { - Peer::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Peer* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "metapb.Peer"; - } - protected: - explicit Peer(::google::protobuf::Arena* arena); - Peer(::google::protobuf::Arena* arena, const Peer& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIdFieldNumber = 1, - kStoreIdFieldNumber = 2, - kRoleFieldNumber = 3, - kIsWitnessFieldNumber = 4, - }; - // uint64 id = 1; - void clear_id() ; - ::uint64_t id() const; - void set_id(::uint64_t value); - - private: - ::uint64_t _internal_id() const; - void _internal_set_id(::uint64_t value); - - public: - // uint64 store_id = 2; - void clear_store_id() ; - ::uint64_t store_id() const; - void set_store_id(::uint64_t value); - - private: - ::uint64_t _internal_store_id() const; - void _internal_set_store_id(::uint64_t value); - - public: - // .metapb.PeerRole role = 3; - void clear_role() ; - ::metapb::PeerRole role() const; - void set_role(::metapb::PeerRole value); - - private: - ::metapb::PeerRole _internal_role() const; - void _internal_set_role(::metapb::PeerRole value); - - public: - // bool is_witness = 4; - void clear_is_witness() ; - bool is_witness() const; - void set_is_witness(bool value); - - private: - bool _internal_is_witness() const; - void _internal_set_is_witness(bool value); - - public: - // @@protoc_insertion_point(class_scope:metapb.Peer) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 4, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::uint64_t id_; - ::uint64_t store_id_; - int role_; - bool is_witness_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_metapb_2eproto; -};// ------------------------------------------------------------------- - -class Cluster final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:metapb.Cluster) */ { - public: - inline Cluster() : Cluster(nullptr) {} - ~Cluster() override; - template - explicit PROTOBUF_CONSTEXPR Cluster(::google::protobuf::internal::ConstantInitialized); - - inline Cluster(const Cluster& from) - : Cluster(nullptr, from) {} - Cluster(Cluster&& from) noexcept - : Cluster() { - *this = ::std::move(from); - } - - inline Cluster& operator=(const Cluster& from) { - CopyFrom(from); - return *this; - } - inline Cluster& operator=(Cluster&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Cluster& default_instance() { - return *internal_default_instance(); - } - static inline const Cluster* internal_default_instance() { - return reinterpret_cast( - &_Cluster_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Cluster& a, Cluster& b) { - a.Swap(&b); - } - inline void Swap(Cluster* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Cluster* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Cluster* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Cluster& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Cluster& from) { - Cluster::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Cluster* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "metapb.Cluster"; - } - protected: - explicit Cluster(::google::protobuf::Arena* arena); - Cluster(::google::protobuf::Arena* arena, const Cluster& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIdFieldNumber = 1, - kMaxPeerCountFieldNumber = 2, - }; - // uint64 id = 1; - void clear_id() ; - ::uint64_t id() const; - void set_id(::uint64_t value); - - private: - ::uint64_t _internal_id() const; - void _internal_set_id(::uint64_t value); - - public: - // uint64 max_peer_count = 2; - void clear_max_peer_count() ; - ::uint64_t max_peer_count() const; - void set_max_peer_count(::uint64_t value); - - private: - ::uint64_t _internal_max_peer_count() const; - void _internal_set_max_peer_count(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:metapb.Cluster) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::uint64_t id_; - ::uint64_t max_peer_count_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_metapb_2eproto; -};// ------------------------------------------------------------------- - -class Store final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:metapb.Store) */ { - public: - inline Store() : Store(nullptr) {} - ~Store() override; - template - explicit PROTOBUF_CONSTEXPR Store(::google::protobuf::internal::ConstantInitialized); - - inline Store(const Store& from) - : Store(nullptr, from) {} - Store(Store&& from) noexcept - : Store() { - *this = ::std::move(from); - } - - inline Store& operator=(const Store& from) { - CopyFrom(from); - return *this; - } - inline Store& operator=(Store&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Store& default_instance() { - return *internal_default_instance(); - } - static inline const Store* internal_default_instance() { - return reinterpret_cast( - &_Store_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(Store& a, Store& b) { - a.Swap(&b); - } - inline void Swap(Store* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Store* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Store* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Store& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Store& from) { - Store::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Store* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "metapb.Store"; - } - protected: - explicit Store(::google::protobuf::Arena* arena); - Store(::google::protobuf::Arena* arena, const Store& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kLabelsFieldNumber = 4, - kAddressFieldNumber = 2, - kVersionFieldNumber = 5, - kStatusAddressFieldNumber = 6, - kGitHashFieldNumber = 7, - kDeployPathFieldNumber = 8, - kPeerAddressFieldNumber = 10, - kIdFieldNumber = 1, - kPhysicallyDestroyedFieldNumber = 9, - kStateFieldNumber = 3, - }; - // repeated .metapb.StoreLabel labels = 4; - int labels_size() const; - private: - int _internal_labels_size() const; - - public: - void clear_labels() ; - ::metapb::StoreLabel* mutable_labels(int index); - ::google::protobuf::RepeatedPtrField< ::metapb::StoreLabel >* - mutable_labels(); - private: - const ::google::protobuf::RepeatedPtrField<::metapb::StoreLabel>& _internal_labels() const; - ::google::protobuf::RepeatedPtrField<::metapb::StoreLabel>* _internal_mutable_labels(); - public: - const ::metapb::StoreLabel& labels(int index) const; - ::metapb::StoreLabel* add_labels(); - const ::google::protobuf::RepeatedPtrField< ::metapb::StoreLabel >& - labels() const; - // string address = 2; - void clear_address() ; - const std::string& address() const; - template - void set_address(Arg_&& arg, Args_... args); - std::string* mutable_address(); - PROTOBUF_NODISCARD std::string* release_address(); - void set_allocated_address(std::string* value); - - private: - const std::string& _internal_address() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_address( - const std::string& value); - std::string* _internal_mutable_address(); - - public: - // string version = 5; - void clear_version() ; - const std::string& version() const; - template - void set_version(Arg_&& arg, Args_... args); - std::string* mutable_version(); - PROTOBUF_NODISCARD std::string* release_version(); - void set_allocated_version(std::string* value); - - private: - const std::string& _internal_version() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_version( - const std::string& value); - std::string* _internal_mutable_version(); - - public: - // string status_address = 6; - void clear_status_address() ; - const std::string& status_address() const; - template - void set_status_address(Arg_&& arg, Args_... args); - std::string* mutable_status_address(); - PROTOBUF_NODISCARD std::string* release_status_address(); - void set_allocated_status_address(std::string* value); - - private: - const std::string& _internal_status_address() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_status_address( - const std::string& value); - std::string* _internal_mutable_status_address(); - - public: - // string git_hash = 7; - void clear_git_hash() ; - const std::string& git_hash() const; - template - void set_git_hash(Arg_&& arg, Args_... args); - std::string* mutable_git_hash(); - PROTOBUF_NODISCARD std::string* release_git_hash(); - void set_allocated_git_hash(std::string* value); - - private: - const std::string& _internal_git_hash() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_git_hash( - const std::string& value); - std::string* _internal_mutable_git_hash(); - - public: - // string deploy_path = 8; - void clear_deploy_path() ; - const std::string& deploy_path() const; - template - void set_deploy_path(Arg_&& arg, Args_... args); - std::string* mutable_deploy_path(); - PROTOBUF_NODISCARD std::string* release_deploy_path(); - void set_allocated_deploy_path(std::string* value); - - private: - const std::string& _internal_deploy_path() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_deploy_path( - const std::string& value); - std::string* _internal_mutable_deploy_path(); - - public: - // string peer_address = 10; - void clear_peer_address() ; - const std::string& peer_address() const; - template - void set_peer_address(Arg_&& arg, Args_... args); - std::string* mutable_peer_address(); - PROTOBUF_NODISCARD std::string* release_peer_address(); - void set_allocated_peer_address(std::string* value); - - private: - const std::string& _internal_peer_address() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_peer_address( - const std::string& value); - std::string* _internal_mutable_peer_address(); - - public: - // uint64 id = 1; - void clear_id() ; - ::uint64_t id() const; - void set_id(::uint64_t value); - - private: - ::uint64_t _internal_id() const; - void _internal_set_id(::uint64_t value); - - public: - // int64 physically_destroyed = 9; - void clear_physically_destroyed() ; - ::int64_t physically_destroyed() const; - void set_physically_destroyed(::int64_t value); - - private: - ::int64_t _internal_physically_destroyed() const; - void _internal_set_physically_destroyed(::int64_t value); - - public: - // .metapb.StoreState state = 3; - void clear_state() ; - ::metapb::StoreState state() const; - void set_state(::metapb::StoreState value); - - private: - ::metapb::StoreState _internal_state() const; - void _internal_set_state(::metapb::StoreState value); - - public: - // @@protoc_insertion_point(class_scope:metapb.Store) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 4, 10, 1, - 88, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::RepeatedPtrField< ::metapb::StoreLabel > labels_; - ::google::protobuf::internal::ArenaStringPtr address_; - ::google::protobuf::internal::ArenaStringPtr version_; - ::google::protobuf::internal::ArenaStringPtr status_address_; - ::google::protobuf::internal::ArenaStringPtr git_hash_; - ::google::protobuf::internal::ArenaStringPtr deploy_path_; - ::google::protobuf::internal::ArenaStringPtr peer_address_; - ::uint64_t id_; - ::int64_t physically_destroyed_; - int state_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_metapb_2eproto; -};// ------------------------------------------------------------------- - -class Region final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:metapb.Region) */ { - public: - inline Region() : Region(nullptr) {} - ~Region() override; - template - explicit PROTOBUF_CONSTEXPR Region(::google::protobuf::internal::ConstantInitialized); - - inline Region(const Region& from) - : Region(nullptr, from) {} - Region(Region&& from) noexcept - : Region() { - *this = ::std::move(from); - } - - inline Region& operator=(const Region& from) { - CopyFrom(from); - return *this; - } - inline Region& operator=(Region&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Region& default_instance() { - return *internal_default_instance(); - } - static inline const Region* internal_default_instance() { - return reinterpret_cast( - &_Region_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(Region& a, Region& b) { - a.Swap(&b); - } - inline void Swap(Region* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Region* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Region* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Region& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Region& from) { - Region::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Region* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "metapb.Region"; - } - protected: - explicit Region(::google::protobuf::Arena* arena); - Region(::google::protobuf::Arena* arena, const Region& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPeersFieldNumber = 5, - kStartKeyFieldNumber = 2, - kEndKeyFieldNumber = 3, - kEncryptionMetaFieldNumber = 6, - kRegionEpochFieldNumber = 4, - kIdFieldNumber = 1, - kIsInFlashbackFieldNumber = 7, - }; - // repeated .metapb.Peer peers = 5; - int peers_size() const; - private: - int _internal_peers_size() const; - - public: - void clear_peers() ; - ::metapb::Peer* mutable_peers(int index); - ::google::protobuf::RepeatedPtrField< ::metapb::Peer >* - mutable_peers(); - private: - const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& _internal_peers() const; - ::google::protobuf::RepeatedPtrField<::metapb::Peer>* _internal_mutable_peers(); - public: - const ::metapb::Peer& peers(int index) const; - ::metapb::Peer* add_peers(); - const ::google::protobuf::RepeatedPtrField< ::metapb::Peer >& - peers() const; - // bytes start_key = 2; - void clear_start_key() ; - const std::string& start_key() const; - template - void set_start_key(Arg_&& arg, Args_... args); - std::string* mutable_start_key(); - PROTOBUF_NODISCARD std::string* release_start_key(); - void set_allocated_start_key(std::string* value); - - private: - const std::string& _internal_start_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_start_key( - const std::string& value); - std::string* _internal_mutable_start_key(); - - public: - // bytes end_key = 3; - void clear_end_key() ; - const std::string& end_key() const; - template - void set_end_key(Arg_&& arg, Args_... args); - std::string* mutable_end_key(); - PROTOBUF_NODISCARD std::string* release_end_key(); - void set_allocated_end_key(std::string* value); - - private: - const std::string& _internal_end_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_end_key( - const std::string& value); - std::string* _internal_mutable_end_key(); - - public: - // bytes encryption_meta = 6; - void clear_encryption_meta() ; - const std::string& encryption_meta() const; - template - void set_encryption_meta(Arg_&& arg, Args_... args); - std::string* mutable_encryption_meta(); - PROTOBUF_NODISCARD std::string* release_encryption_meta(); - void set_allocated_encryption_meta(std::string* value); - - private: - const std::string& _internal_encryption_meta() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_encryption_meta( - const std::string& value); - std::string* _internal_mutable_encryption_meta(); - - public: - // .metapb.RegionEpoch region_epoch = 4; - bool has_region_epoch() const; - void clear_region_epoch() ; - const ::metapb::RegionEpoch& region_epoch() const; - PROTOBUF_NODISCARD ::metapb::RegionEpoch* release_region_epoch(); - ::metapb::RegionEpoch* mutable_region_epoch(); - void set_allocated_region_epoch(::metapb::RegionEpoch* value); - void unsafe_arena_set_allocated_region_epoch(::metapb::RegionEpoch* value); - ::metapb::RegionEpoch* unsafe_arena_release_region_epoch(); - - private: - const ::metapb::RegionEpoch& _internal_region_epoch() const; - ::metapb::RegionEpoch* _internal_mutable_region_epoch(); - - public: - // uint64 id = 1; - void clear_id() ; - ::uint64_t id() const; - void set_id(::uint64_t value); - - private: - ::uint64_t _internal_id() const; - void _internal_set_id(::uint64_t value); - - public: - // bool is_in_flashback = 7; - void clear_is_in_flashback() ; - bool is_in_flashback() const; - void set_is_in_flashback(bool value); - - private: - bool _internal_is_in_flashback() const; - void _internal_set_is_in_flashback(bool value); - - public: - // @@protoc_insertion_point(class_scope:metapb.Region) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 7, 2, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField< ::metapb::Peer > peers_; - ::google::protobuf::internal::ArenaStringPtr start_key_; - ::google::protobuf::internal::ArenaStringPtr end_key_; - ::google::protobuf::internal::ArenaStringPtr encryption_meta_; - ::metapb::RegionEpoch* region_epoch_; - ::uint64_t id_; - bool is_in_flashback_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_metapb_2eproto; -}; - -// =================================================================== - - - - -// =================================================================== - - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// Cluster - -// uint64 id = 1; -inline void Cluster::clear_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.id_ = ::uint64_t{0u}; -} -inline ::uint64_t Cluster::id() const { - // @@protoc_insertion_point(field_get:metapb.Cluster.id) - return _internal_id(); -} -inline void Cluster::set_id(::uint64_t value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:metapb.Cluster.id) -} -inline ::uint64_t Cluster::_internal_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.id_; -} -inline void Cluster::_internal_set_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.id_ = value; -} - -// uint64 max_peer_count = 2; -inline void Cluster::clear_max_peer_count() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.max_peer_count_ = ::uint64_t{0u}; -} -inline ::uint64_t Cluster::max_peer_count() const { - // @@protoc_insertion_point(field_get:metapb.Cluster.max_peer_count) - return _internal_max_peer_count(); -} -inline void Cluster::set_max_peer_count(::uint64_t value) { - _internal_set_max_peer_count(value); - // @@protoc_insertion_point(field_set:metapb.Cluster.max_peer_count) -} -inline ::uint64_t Cluster::_internal_max_peer_count() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.max_peer_count_; -} -inline void Cluster::_internal_set_max_peer_count(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.max_peer_count_ = value; -} - -// ------------------------------------------------------------------- - -// Store - -// uint64 id = 1; -inline void Store::clear_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.id_ = ::uint64_t{0u}; -} -inline ::uint64_t Store::id() const { - // @@protoc_insertion_point(field_get:metapb.Store.id) - return _internal_id(); -} -inline void Store::set_id(::uint64_t value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:metapb.Store.id) -} -inline ::uint64_t Store::_internal_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.id_; -} -inline void Store::_internal_set_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.id_ = value; -} - -// string address = 2; -inline void Store::clear_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.address_.ClearToEmpty(); -} -inline const std::string& Store::address() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Store.address) - return _internal_address(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Store::set_address(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.address_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Store.address) -} -inline std::string* Store::mutable_address() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_address(); - // @@protoc_insertion_point(field_mutable:metapb.Store.address) - return _s; -} -inline const std::string& Store::_internal_address() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.address_.Get(); -} -inline void Store::_internal_set_address(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.address_.Set(value, GetArena()); -} -inline std::string* Store::_internal_mutable_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.address_.Mutable( GetArena()); -} -inline std::string* Store::release_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Store.address) - return _impl_.address_.Release(); -} -inline void Store::set_allocated_address(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.address_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.address_.IsDefault()) { - _impl_.address_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Store.address) -} - -// .metapb.StoreState state = 3; -inline void Store::clear_state() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.state_ = 0; -} -inline ::metapb::StoreState Store::state() const { - // @@protoc_insertion_point(field_get:metapb.Store.state) - return _internal_state(); -} -inline void Store::set_state(::metapb::StoreState value) { - _internal_set_state(value); - // @@protoc_insertion_point(field_set:metapb.Store.state) -} -inline ::metapb::StoreState Store::_internal_state() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::metapb::StoreState>(_impl_.state_); -} -inline void Store::_internal_set_state(::metapb::StoreState value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.state_ = value; -} - -// repeated .metapb.StoreLabel labels = 4; -inline int Store::_internal_labels_size() const { - return _internal_labels().size(); -} -inline int Store::labels_size() const { - return _internal_labels_size(); -} -inline void Store::clear_labels() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.labels_.Clear(); -} -inline ::metapb::StoreLabel* Store::mutable_labels(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:metapb.Store.labels) - return _internal_mutable_labels()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::metapb::StoreLabel>* Store::mutable_labels() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:metapb.Store.labels) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_labels(); -} -inline const ::metapb::StoreLabel& Store::labels(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Store.labels) - return _internal_labels().Get(index); -} -inline ::metapb::StoreLabel* Store::add_labels() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::metapb::StoreLabel* _add = _internal_mutable_labels()->Add(); - // @@protoc_insertion_point(field_add:metapb.Store.labels) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::StoreLabel>& Store::labels() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:metapb.Store.labels) - return _internal_labels(); -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::StoreLabel>& -Store::_internal_labels() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.labels_; -} -inline ::google::protobuf::RepeatedPtrField<::metapb::StoreLabel>* -Store::_internal_mutable_labels() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.labels_; -} - -// string version = 5; -inline void Store::clear_version() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.version_.ClearToEmpty(); -} -inline const std::string& Store::version() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Store.version) - return _internal_version(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Store::set_version(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.version_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Store.version) -} -inline std::string* Store::mutable_version() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_version(); - // @@protoc_insertion_point(field_mutable:metapb.Store.version) - return _s; -} -inline const std::string& Store::_internal_version() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.version_.Get(); -} -inline void Store::_internal_set_version(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.version_.Set(value, GetArena()); -} -inline std::string* Store::_internal_mutable_version() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.version_.Mutable( GetArena()); -} -inline std::string* Store::release_version() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Store.version) - return _impl_.version_.Release(); -} -inline void Store::set_allocated_version(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.version_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.version_.IsDefault()) { - _impl_.version_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Store.version) -} - -// string status_address = 6; -inline void Store::clear_status_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.status_address_.ClearToEmpty(); -} -inline const std::string& Store::status_address() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Store.status_address) - return _internal_status_address(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Store::set_status_address(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.status_address_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Store.status_address) -} -inline std::string* Store::mutable_status_address() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_status_address(); - // @@protoc_insertion_point(field_mutable:metapb.Store.status_address) - return _s; -} -inline const std::string& Store::_internal_status_address() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.status_address_.Get(); -} -inline void Store::_internal_set_status_address(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.status_address_.Set(value, GetArena()); -} -inline std::string* Store::_internal_mutable_status_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.status_address_.Mutable( GetArena()); -} -inline std::string* Store::release_status_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Store.status_address) - return _impl_.status_address_.Release(); -} -inline void Store::set_allocated_status_address(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.status_address_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.status_address_.IsDefault()) { - _impl_.status_address_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Store.status_address) -} - -// string git_hash = 7; -inline void Store::clear_git_hash() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.git_hash_.ClearToEmpty(); -} -inline const std::string& Store::git_hash() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Store.git_hash) - return _internal_git_hash(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Store::set_git_hash(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.git_hash_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Store.git_hash) -} -inline std::string* Store::mutable_git_hash() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_git_hash(); - // @@protoc_insertion_point(field_mutable:metapb.Store.git_hash) - return _s; -} -inline const std::string& Store::_internal_git_hash() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.git_hash_.Get(); -} -inline void Store::_internal_set_git_hash(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.git_hash_.Set(value, GetArena()); -} -inline std::string* Store::_internal_mutable_git_hash() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.git_hash_.Mutable( GetArena()); -} -inline std::string* Store::release_git_hash() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Store.git_hash) - return _impl_.git_hash_.Release(); -} -inline void Store::set_allocated_git_hash(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.git_hash_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.git_hash_.IsDefault()) { - _impl_.git_hash_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Store.git_hash) -} - -// string deploy_path = 8; -inline void Store::clear_deploy_path() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.deploy_path_.ClearToEmpty(); -} -inline const std::string& Store::deploy_path() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Store.deploy_path) - return _internal_deploy_path(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Store::set_deploy_path(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.deploy_path_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Store.deploy_path) -} -inline std::string* Store::mutable_deploy_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_deploy_path(); - // @@protoc_insertion_point(field_mutable:metapb.Store.deploy_path) - return _s; -} -inline const std::string& Store::_internal_deploy_path() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.deploy_path_.Get(); -} -inline void Store::_internal_set_deploy_path(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.deploy_path_.Set(value, GetArena()); -} -inline std::string* Store::_internal_mutable_deploy_path() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.deploy_path_.Mutable( GetArena()); -} -inline std::string* Store::release_deploy_path() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Store.deploy_path) - return _impl_.deploy_path_.Release(); -} -inline void Store::set_allocated_deploy_path(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.deploy_path_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.deploy_path_.IsDefault()) { - _impl_.deploy_path_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Store.deploy_path) -} - -// int64 physically_destroyed = 9; -inline void Store::clear_physically_destroyed() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.physically_destroyed_ = ::int64_t{0}; -} -inline ::int64_t Store::physically_destroyed() const { - // @@protoc_insertion_point(field_get:metapb.Store.physically_destroyed) - return _internal_physically_destroyed(); -} -inline void Store::set_physically_destroyed(::int64_t value) { - _internal_set_physically_destroyed(value); - // @@protoc_insertion_point(field_set:metapb.Store.physically_destroyed) -} -inline ::int64_t Store::_internal_physically_destroyed() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.physically_destroyed_; -} -inline void Store::_internal_set_physically_destroyed(::int64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.physically_destroyed_ = value; -} - -// string peer_address = 10; -inline void Store::clear_peer_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.peer_address_.ClearToEmpty(); -} -inline const std::string& Store::peer_address() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Store.peer_address) - return _internal_peer_address(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Store::set_peer_address(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.peer_address_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Store.peer_address) -} -inline std::string* Store::mutable_peer_address() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_peer_address(); - // @@protoc_insertion_point(field_mutable:metapb.Store.peer_address) - return _s; -} -inline const std::string& Store::_internal_peer_address() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.peer_address_.Get(); -} -inline void Store::_internal_set_peer_address(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.peer_address_.Set(value, GetArena()); -} -inline std::string* Store::_internal_mutable_peer_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.peer_address_.Mutable( GetArena()); -} -inline std::string* Store::release_peer_address() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Store.peer_address) - return _impl_.peer_address_.Release(); -} -inline void Store::set_allocated_peer_address(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.peer_address_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.peer_address_.IsDefault()) { - _impl_.peer_address_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Store.peer_address) -} - -// ------------------------------------------------------------------- - -// StoreLabel - -// string key = 1; -inline void StoreLabel::clear_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.ClearToEmpty(); -} -inline const std::string& StoreLabel::key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.StoreLabel.key) - return _internal_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void StoreLabel::set_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.StoreLabel.key) -} -inline std::string* StoreLabel::mutable_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_key(); - // @@protoc_insertion_point(field_mutable:metapb.StoreLabel.key) - return _s; -} -inline const std::string& StoreLabel::_internal_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.key_.Get(); -} -inline void StoreLabel::_internal_set_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.key_.Set(value, GetArena()); -} -inline std::string* StoreLabel::_internal_mutable_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.key_.Mutable( GetArena()); -} -inline std::string* StoreLabel::release_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.StoreLabel.key) - return _impl_.key_.Release(); -} -inline void StoreLabel::set_allocated_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.key_.IsDefault()) { - _impl_.key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.StoreLabel.key) -} - -// string value = 2; -inline void StoreLabel::clear_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.ClearToEmpty(); -} -inline const std::string& StoreLabel::value() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.StoreLabel.value) - return _internal_value(); -} -template -inline PROTOBUF_ALWAYS_INLINE void StoreLabel::set_value(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.StoreLabel.value) -} -inline std::string* StoreLabel::mutable_value() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_value(); - // @@protoc_insertion_point(field_mutable:metapb.StoreLabel.value) - return _s; -} -inline const std::string& StoreLabel::_internal_value() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.value_.Get(); -} -inline void StoreLabel::_internal_set_value(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.value_.Set(value, GetArena()); -} -inline std::string* StoreLabel::_internal_mutable_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.value_.Mutable( GetArena()); -} -inline std::string* StoreLabel::release_value() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.StoreLabel.value) - return _impl_.value_.Release(); -} -inline void StoreLabel::set_allocated_value(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.value_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.value_.IsDefault()) { - _impl_.value_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.StoreLabel.value) -} - -// ------------------------------------------------------------------- - -// Region - -// uint64 id = 1; -inline void Region::clear_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.id_ = ::uint64_t{0u}; -} -inline ::uint64_t Region::id() const { - // @@protoc_insertion_point(field_get:metapb.Region.id) - return _internal_id(); -} -inline void Region::set_id(::uint64_t value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:metapb.Region.id) -} -inline ::uint64_t Region::_internal_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.id_; -} -inline void Region::_internal_set_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.id_ = value; -} - -// bytes start_key = 2; -inline void Region::clear_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.ClearToEmpty(); -} -inline const std::string& Region::start_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Region.start_key) - return _internal_start_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Region::set_start_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Region.start_key) -} -inline std::string* Region::mutable_start_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_start_key(); - // @@protoc_insertion_point(field_mutable:metapb.Region.start_key) - return _s; -} -inline const std::string& Region::_internal_start_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.start_key_.Get(); -} -inline void Region::_internal_set_start_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.start_key_.Set(value, GetArena()); -} -inline std::string* Region::_internal_mutable_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.start_key_.Mutable( GetArena()); -} -inline std::string* Region::release_start_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Region.start_key) - return _impl_.start_key_.Release(); -} -inline void Region::set_allocated_start_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.start_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.start_key_.IsDefault()) { - _impl_.start_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Region.start_key) -} - -// bytes end_key = 3; -inline void Region::clear_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.ClearToEmpty(); -} -inline const std::string& Region::end_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Region.end_key) - return _internal_end_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Region::set_end_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Region.end_key) -} -inline std::string* Region::mutable_end_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_end_key(); - // @@protoc_insertion_point(field_mutable:metapb.Region.end_key) - return _s; -} -inline const std::string& Region::_internal_end_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.end_key_.Get(); -} -inline void Region::_internal_set_end_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.end_key_.Set(value, GetArena()); -} -inline std::string* Region::_internal_mutable_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.end_key_.Mutable( GetArena()); -} -inline std::string* Region::release_end_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Region.end_key) - return _impl_.end_key_.Release(); -} -inline void Region::set_allocated_end_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.end_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.end_key_.IsDefault()) { - _impl_.end_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Region.end_key) -} - -// .metapb.RegionEpoch region_epoch = 4; -inline bool Region::has_region_epoch() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_epoch_ != nullptr); - return value; -} -inline void Region::clear_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_epoch_ != nullptr) _impl_.region_epoch_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::metapb::RegionEpoch& Region::_internal_region_epoch() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::metapb::RegionEpoch* p = _impl_.region_epoch_; - return p != nullptr ? *p : reinterpret_cast(::metapb::_RegionEpoch_default_instance_); -} -inline const ::metapb::RegionEpoch& Region::region_epoch() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Region.region_epoch) - return _internal_region_epoch(); -} -inline void Region::unsafe_arena_set_allocated_region_epoch(::metapb::RegionEpoch* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_epoch_); - } - _impl_.region_epoch_ = reinterpret_cast<::metapb::RegionEpoch*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:metapb.Region.region_epoch) -} -inline ::metapb::RegionEpoch* Region::release_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::metapb::RegionEpoch* released = _impl_.region_epoch_; - _impl_.region_epoch_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::metapb::RegionEpoch* Region::unsafe_arena_release_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Region.region_epoch) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::metapb::RegionEpoch* temp = _impl_.region_epoch_; - _impl_.region_epoch_ = nullptr; - return temp; -} -inline ::metapb::RegionEpoch* Region::_internal_mutable_region_epoch() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.region_epoch_ == nullptr) { - auto* p = CreateMaybeMessage<::metapb::RegionEpoch>(GetArena()); - _impl_.region_epoch_ = reinterpret_cast<::metapb::RegionEpoch*>(p); - } - return _impl_.region_epoch_; -} -inline ::metapb::RegionEpoch* Region::mutable_region_epoch() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::metapb::RegionEpoch* _msg = _internal_mutable_region_epoch(); - // @@protoc_insertion_point(field_mutable:metapb.Region.region_epoch) - return _msg; -} -inline void Region::set_allocated_region_epoch(::metapb::RegionEpoch* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::metapb::RegionEpoch*>(_impl_.region_epoch_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::metapb::RegionEpoch*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.region_epoch_ = reinterpret_cast<::metapb::RegionEpoch*>(value); - // @@protoc_insertion_point(field_set_allocated:metapb.Region.region_epoch) -} - -// repeated .metapb.Peer peers = 5; -inline int Region::_internal_peers_size() const { - return _internal_peers().size(); -} -inline int Region::peers_size() const { - return _internal_peers_size(); -} -inline void Region::clear_peers() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.peers_.Clear(); -} -inline ::metapb::Peer* Region::mutable_peers(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:metapb.Region.peers) - return _internal_mutable_peers()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Peer>* Region::mutable_peers() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:metapb.Region.peers) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_peers(); -} -inline const ::metapb::Peer& Region::peers(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Region.peers) - return _internal_peers().Get(index); -} -inline ::metapb::Peer* Region::add_peers() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::metapb::Peer* _add = _internal_mutable_peers()->Add(); - // @@protoc_insertion_point(field_add:metapb.Region.peers) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& Region::peers() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:metapb.Region.peers) - return _internal_peers(); -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& -Region::_internal_peers() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.peers_; -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Peer>* -Region::_internal_mutable_peers() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.peers_; -} - -// bytes encryption_meta = 6; -inline void Region::clear_encryption_meta() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.encryption_meta_.ClearToEmpty(); -} -inline const std::string& Region::encryption_meta() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:metapb.Region.encryption_meta) - return _internal_encryption_meta(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Region::set_encryption_meta(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.encryption_meta_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:metapb.Region.encryption_meta) -} -inline std::string* Region::mutable_encryption_meta() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_encryption_meta(); - // @@protoc_insertion_point(field_mutable:metapb.Region.encryption_meta) - return _s; -} -inline const std::string& Region::_internal_encryption_meta() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.encryption_meta_.Get(); -} -inline void Region::_internal_set_encryption_meta(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.encryption_meta_.Set(value, GetArena()); -} -inline std::string* Region::_internal_mutable_encryption_meta() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.encryption_meta_.Mutable( GetArena()); -} -inline std::string* Region::release_encryption_meta() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:metapb.Region.encryption_meta) - return _impl_.encryption_meta_.Release(); -} -inline void Region::set_allocated_encryption_meta(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.encryption_meta_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.encryption_meta_.IsDefault()) { - _impl_.encryption_meta_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:metapb.Region.encryption_meta) -} - -// bool is_in_flashback = 7; -inline void Region::clear_is_in_flashback() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.is_in_flashback_ = false; -} -inline bool Region::is_in_flashback() const { - // @@protoc_insertion_point(field_get:metapb.Region.is_in_flashback) - return _internal_is_in_flashback(); -} -inline void Region::set_is_in_flashback(bool value) { - _internal_set_is_in_flashback(value); - // @@protoc_insertion_point(field_set:metapb.Region.is_in_flashback) -} -inline bool Region::_internal_is_in_flashback() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.is_in_flashback_; -} -inline void Region::_internal_set_is_in_flashback(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.is_in_flashback_ = value; -} - -// ------------------------------------------------------------------- - -// RegionEpoch - -// uint64 conf_ver = 1; -inline void RegionEpoch::clear_conf_ver() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.conf_ver_ = ::uint64_t{0u}; -} -inline ::uint64_t RegionEpoch::conf_ver() const { - // @@protoc_insertion_point(field_get:metapb.RegionEpoch.conf_ver) - return _internal_conf_ver(); -} -inline void RegionEpoch::set_conf_ver(::uint64_t value) { - _internal_set_conf_ver(value); - // @@protoc_insertion_point(field_set:metapb.RegionEpoch.conf_ver) -} -inline ::uint64_t RegionEpoch::_internal_conf_ver() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.conf_ver_; -} -inline void RegionEpoch::_internal_set_conf_ver(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.conf_ver_ = value; -} - -// uint64 version = 2; -inline void RegionEpoch::clear_version() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.version_ = ::uint64_t{0u}; -} -inline ::uint64_t RegionEpoch::version() const { - // @@protoc_insertion_point(field_get:metapb.RegionEpoch.version) - return _internal_version(); -} -inline void RegionEpoch::set_version(::uint64_t value) { - _internal_set_version(value); - // @@protoc_insertion_point(field_set:metapb.RegionEpoch.version) -} -inline ::uint64_t RegionEpoch::_internal_version() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.version_; -} -inline void RegionEpoch::_internal_set_version(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.version_ = value; -} - -// ------------------------------------------------------------------- - -// Peer - -// uint64 id = 1; -inline void Peer::clear_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.id_ = ::uint64_t{0u}; -} -inline ::uint64_t Peer::id() const { - // @@protoc_insertion_point(field_get:metapb.Peer.id) - return _internal_id(); -} -inline void Peer::set_id(::uint64_t value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:metapb.Peer.id) -} -inline ::uint64_t Peer::_internal_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.id_; -} -inline void Peer::_internal_set_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.id_ = value; -} - -// uint64 store_id = 2; -inline void Peer::clear_store_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.store_id_ = ::uint64_t{0u}; -} -inline ::uint64_t Peer::store_id() const { - // @@protoc_insertion_point(field_get:metapb.Peer.store_id) - return _internal_store_id(); -} -inline void Peer::set_store_id(::uint64_t value) { - _internal_set_store_id(value); - // @@protoc_insertion_point(field_set:metapb.Peer.store_id) -} -inline ::uint64_t Peer::_internal_store_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.store_id_; -} -inline void Peer::_internal_set_store_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.store_id_ = value; -} - -// .metapb.PeerRole role = 3; -inline void Peer::clear_role() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.role_ = 0; -} -inline ::metapb::PeerRole Peer::role() const { - // @@protoc_insertion_point(field_get:metapb.Peer.role) - return _internal_role(); -} -inline void Peer::set_role(::metapb::PeerRole value) { - _internal_set_role(value); - // @@protoc_insertion_point(field_set:metapb.Peer.role) -} -inline ::metapb::PeerRole Peer::_internal_role() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::metapb::PeerRole>(_impl_.role_); -} -inline void Peer::_internal_set_role(::metapb::PeerRole value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.role_ = value; -} - -// bool is_witness = 4; -inline void Peer::clear_is_witness() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.is_witness_ = false; -} -inline bool Peer::is_witness() const { - // @@protoc_insertion_point(field_get:metapb.Peer.is_witness) - return _internal_is_witness(); -} -inline void Peer::set_is_witness(bool value) { - _internal_set_is_witness(value); - // @@protoc_insertion_point(field_set:metapb.Peer.is_witness) -} -inline bool Peer::_internal_is_witness() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.is_witness_; -} -inline void Peer::_internal_set_is_witness(bool value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.is_witness_ = value; -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) -} // namespace metapb - - -namespace google { -namespace protobuf { - -template <> -struct is_proto_enum<::metapb::StoreState> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::metapb::StoreState>() { - return ::metapb::StoreState_descriptor(); -} -template <> -struct is_proto_enum<::metapb::PeerRole> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::metapb::PeerRole>() { - return ::metapb::PeerRole_descriptor(); -} - -} // namespace protobuf -} // namespace google - -// @@protoc_insertion_point(global_scope) - -#include "google/protobuf/port_undef.inc" - -#endif // GOOGLE_PROTOBUF_INCLUDED_metapb_2eproto_2epb_2eh diff --git a/ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.cc b/ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.cc deleted file mode 100644 index 46b20339a..000000000 --- a/ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.cc +++ /dev/null @@ -1,212 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: pdpb.proto - -#include "pdpb.pb.h" -#include "pdpb.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace pdpb { - -static const char* PD_method_names[] = { - "/pdpb.PD/GetMembers", - "/pdpb.PD/GetRegion", - "/pdpb.PD/GetRegionByID", - "/pdpb.PD/GetStore", -}; - -std::unique_ptr< PD::Stub> PD::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< PD::Stub> stub(new PD::Stub(channel, options)); - return stub; -} - -PD::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) - : channel_(channel), rpcmethod_GetMembers_(PD_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_GetRegion_(PD_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_GetRegionByID_(PD_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_GetStore_(PD_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - {} - -::grpc::Status PD::Stub::GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::pdpb::GetMembersResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetMembers_, context, request, response); -} - -void PD::Stub::async::GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetMembers_, context, request, response, std::move(f)); -} - -void PD::Stub::async::GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetMembers_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>* PD::Stub::PrepareAsyncGetMembersRaw(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::pdpb::GetMembersResponse, ::pdpb::GetMembersRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetMembers_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>* PD::Stub::AsyncGetMembersRaw(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncGetMembersRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status PD::Stub::GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::pdpb::GetRegionResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetRegion_, context, request, response); -} - -void PD::Stub::async::GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetRegion_, context, request, response, std::move(f)); -} - -void PD::Stub::async::GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetRegion_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* PD::Stub::PrepareAsyncGetRegionRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::pdpb::GetRegionResponse, ::pdpb::GetRegionRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetRegion_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* PD::Stub::AsyncGetRegionRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncGetRegionRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status PD::Stub::GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::pdpb::GetRegionResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetRegionByID_, context, request, response); -} - -void PD::Stub::async::GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetRegionByID_, context, request, response, std::move(f)); -} - -void PD::Stub::async::GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetRegionByID_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* PD::Stub::PrepareAsyncGetRegionByIDRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::pdpb::GetRegionResponse, ::pdpb::GetRegionRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetRegionByID_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* PD::Stub::AsyncGetRegionByIDRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncGetRegionByIDRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status PD::Stub::GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::pdpb::GetStoreResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetStore_, context, request, response); -} - -void PD::Stub::async::GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetStore_, context, request, response, std::move(f)); -} - -void PD::Stub::async::GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetStore_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>* PD::Stub::PrepareAsyncGetStoreRaw(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::pdpb::GetStoreResponse, ::pdpb::GetStoreRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetStore_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>* PD::Stub::AsyncGetStoreRaw(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncGetStoreRaw(context, request, cq); - result->StartCall(); - return result; -} - -PD::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - PD_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< PD::Service, ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](PD::Service* service, - ::grpc::ServerContext* ctx, - const ::pdpb::GetMembersRequest* req, - ::pdpb::GetMembersResponse* resp) { - return service->GetMembers(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - PD_method_names[1], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< PD::Service, ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](PD::Service* service, - ::grpc::ServerContext* ctx, - const ::pdpb::GetRegionRequest* req, - ::pdpb::GetRegionResponse* resp) { - return service->GetRegion(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - PD_method_names[2], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< PD::Service, ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](PD::Service* service, - ::grpc::ServerContext* ctx, - const ::pdpb::GetRegionRequest* req, - ::pdpb::GetRegionResponse* resp) { - return service->GetRegionByID(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - PD_method_names[3], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< PD::Service, ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](PD::Service* service, - ::grpc::ServerContext* ctx, - const ::pdpb::GetStoreRequest* req, - ::pdpb::GetStoreResponse* resp) { - return service->GetStore(ctx, req, resp); - }, this))); -} - -PD::Service::~Service() { -} - -::grpc::Status PD::Service::GetMembers(::grpc::ServerContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status PD::Service::GetRegion(::grpc::ServerContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status PD::Service::GetRegionByID(::grpc::ServerContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status PD::Service::GetStore(::grpc::ServerContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace pdpb - diff --git a/ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.h b/ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.h deleted file mode 100644 index bf277274b..000000000 --- a/ThirdParty/kvproto/generated/kvproto/pdpb.grpc.pb.h +++ /dev/null @@ -1,716 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: pdpb.proto -// Original file comments: -// Extracted from https://github.com/pingcap/kvproto -// Minimal definitions for SPANN TiKV integration - PD (Placement Driver) service. -// -#ifndef GRPC_pdpb_2eproto__INCLUDED -#define GRPC_pdpb_2eproto__INCLUDED - -#include "pdpb.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace pdpb { - -// PD service - only the RPCs needed for region/store discovery. -class PD final { - public: - static constexpr char const* service_full_name() { - return "pdpb.PD"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - virtual ::grpc::Status GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::pdpb::GetMembersResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetMembersResponse>> AsyncGetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetMembersResponse>>(AsyncGetMembersRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetMembersResponse>> PrepareAsyncGetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetMembersResponse>>(PrepareAsyncGetMembersRaw(context, request, cq)); - } - virtual ::grpc::Status GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::pdpb::GetRegionResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>> AsyncGetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>>(AsyncGetRegionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>> PrepareAsyncGetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>>(PrepareAsyncGetRegionRaw(context, request, cq)); - } - virtual ::grpc::Status GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::pdpb::GetRegionResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>> AsyncGetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>>(AsyncGetRegionByIDRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>> PrepareAsyncGetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>>(PrepareAsyncGetRegionByIDRaw(context, request, cq)); - } - virtual ::grpc::Status GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::pdpb::GetStoreResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetStoreResponse>> AsyncGetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetStoreResponse>>(AsyncGetStoreRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetStoreResponse>> PrepareAsyncGetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetStoreResponse>>(PrepareAsyncGetStoreRaw(context, request, cq)); - } - class async_interface { - public: - virtual ~async_interface() {} - virtual void GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response, std::function) = 0; - virtual void GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, std::function) = 0; - virtual void GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, std::function) = 0; - virtual void GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response, std::function) = 0; - virtual void GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - }; - typedef class async_interface experimental_async_interface; - virtual class async_interface* async() { return nullptr; } - class async_interface* experimental_async() { return async(); } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetMembersResponse>* AsyncGetMembersRaw(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetMembersResponse>* PrepareAsyncGetMembersRaw(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>* AsyncGetRegionRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>* PrepareAsyncGetRegionRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>* AsyncGetRegionByIDRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetRegionResponse>* PrepareAsyncGetRegionByIDRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetStoreResponse>* AsyncGetStoreRaw(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::pdpb::GetStoreResponse>* PrepareAsyncGetStoreRaw(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); - ::grpc::Status GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::pdpb::GetMembersResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>> AsyncGetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>>(AsyncGetMembersRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>> PrepareAsyncGetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>>(PrepareAsyncGetMembersRaw(context, request, cq)); - } - ::grpc::Status GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::pdpb::GetRegionResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>> AsyncGetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>>(AsyncGetRegionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>> PrepareAsyncGetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>>(PrepareAsyncGetRegionRaw(context, request, cq)); - } - ::grpc::Status GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::pdpb::GetRegionResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>> AsyncGetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>>(AsyncGetRegionByIDRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>> PrepareAsyncGetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>>(PrepareAsyncGetRegionByIDRaw(context, request, cq)); - } - ::grpc::Status GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::pdpb::GetStoreResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>> AsyncGetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>>(AsyncGetStoreRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>> PrepareAsyncGetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>>(PrepareAsyncGetStoreRaw(context, request, cq)); - } - class async final : - public StubInterface::async_interface { - public: - void GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response, std::function) override; - void GetMembers(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, std::function) override; - void GetRegion(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, std::function) override; - void GetRegionByID(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response, std::function) override; - void GetStore(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - private: - friend class Stub; - explicit async(Stub* stub): stub_(stub) { } - Stub* stub() { return stub_; } - Stub* stub_; - }; - class async* async() override { return &async_stub_; } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - class async async_stub_{this}; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>* AsyncGetMembersRaw(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetMembersResponse>* PrepareAsyncGetMembersRaw(::grpc::ClientContext* context, const ::pdpb::GetMembersRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* AsyncGetRegionRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* PrepareAsyncGetRegionRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* AsyncGetRegionByIDRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetRegionResponse>* PrepareAsyncGetRegionByIDRaw(::grpc::ClientContext* context, const ::pdpb::GetRegionRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>* AsyncGetStoreRaw(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::pdpb::GetStoreResponse>* PrepareAsyncGetStoreRaw(::grpc::ClientContext* context, const ::pdpb::GetStoreRequest& request, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_GetMembers_; - const ::grpc::internal::RpcMethod rpcmethod_GetRegion_; - const ::grpc::internal::RpcMethod rpcmethod_GetRegionByID_; - const ::grpc::internal::RpcMethod rpcmethod_GetStore_; - }; - static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); - - class Service : public ::grpc::Service { - public: - Service(); - virtual ~Service(); - virtual ::grpc::Status GetMembers(::grpc::ServerContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response); - virtual ::grpc::Status GetRegion(::grpc::ServerContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response); - virtual ::grpc::Status GetRegionByID(::grpc::ServerContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response); - virtual ::grpc::Status GetStore(::grpc::ServerContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response); - }; - template - class WithAsyncMethod_GetMembers : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_GetMembers() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_GetMembers() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetMembers(::grpc::ServerContext* /*context*/, const ::pdpb::GetMembersRequest* /*request*/, ::pdpb::GetMembersResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetMembers(::grpc::ServerContext* context, ::pdpb::GetMembersRequest* request, ::grpc::ServerAsyncResponseWriter< ::pdpb::GetMembersResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_GetRegion : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_GetRegion() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_GetRegion() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegion(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetRegion(::grpc::ServerContext* context, ::pdpb::GetRegionRequest* request, ::grpc::ServerAsyncResponseWriter< ::pdpb::GetRegionResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_GetRegionByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_GetRegionByID() { - ::grpc::Service::MarkMethodAsync(2); - } - ~WithAsyncMethod_GetRegionByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegionByID(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetRegionByID(::grpc::ServerContext* context, ::pdpb::GetRegionRequest* request, ::grpc::ServerAsyncResponseWriter< ::pdpb::GetRegionResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_GetStore : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_GetStore() { - ::grpc::Service::MarkMethodAsync(3); - } - ~WithAsyncMethod_GetStore() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetStore(::grpc::ServerContext* /*context*/, const ::pdpb::GetStoreRequest* /*request*/, ::pdpb::GetStoreResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetStore(::grpc::ServerContext* context, ::pdpb::GetStoreRequest* request, ::grpc::ServerAsyncResponseWriter< ::pdpb::GetStoreResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); - } - }; - typedef WithAsyncMethod_GetMembers > > > AsyncService; - template - class WithCallbackMethod_GetMembers : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_GetMembers() { - ::grpc::Service::MarkMethodCallback(0, - new ::grpc::internal::CallbackUnaryHandler< ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::pdpb::GetMembersRequest* request, ::pdpb::GetMembersResponse* response) { return this->GetMembers(context, request, response); }));} - void SetMessageAllocatorFor_GetMembers( - ::grpc::MessageAllocator< ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - static_cast<::grpc::internal::CallbackUnaryHandler< ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_GetMembers() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetMembers(::grpc::ServerContext* /*context*/, const ::pdpb::GetMembersRequest* /*request*/, ::pdpb::GetMembersResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetMembers( - ::grpc::CallbackServerContext* /*context*/, const ::pdpb::GetMembersRequest* /*request*/, ::pdpb::GetMembersResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_GetRegion : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_GetRegion() { - ::grpc::Service::MarkMethodCallback(1, - new ::grpc::internal::CallbackUnaryHandler< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response) { return this->GetRegion(context, request, response); }));} - void SetMessageAllocatorFor_GetRegion( - ::grpc::MessageAllocator< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); - static_cast<::grpc::internal::CallbackUnaryHandler< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_GetRegion() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegion(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetRegion( - ::grpc::CallbackServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_GetRegionByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_GetRegionByID() { - ::grpc::Service::MarkMethodCallback(2, - new ::grpc::internal::CallbackUnaryHandler< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::pdpb::GetRegionRequest* request, ::pdpb::GetRegionResponse* response) { return this->GetRegionByID(context, request, response); }));} - void SetMessageAllocatorFor_GetRegionByID( - ::grpc::MessageAllocator< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); - static_cast<::grpc::internal::CallbackUnaryHandler< ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_GetRegionByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegionByID(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetRegionByID( - ::grpc::CallbackServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_GetStore : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_GetStore() { - ::grpc::Service::MarkMethodCallback(3, - new ::grpc::internal::CallbackUnaryHandler< ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::pdpb::GetStoreRequest* request, ::pdpb::GetStoreResponse* response) { return this->GetStore(context, request, response); }));} - void SetMessageAllocatorFor_GetStore( - ::grpc::MessageAllocator< ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); - static_cast<::grpc::internal::CallbackUnaryHandler< ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_GetStore() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetStore(::grpc::ServerContext* /*context*/, const ::pdpb::GetStoreRequest* /*request*/, ::pdpb::GetStoreResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetStore( - ::grpc::CallbackServerContext* /*context*/, const ::pdpb::GetStoreRequest* /*request*/, ::pdpb::GetStoreResponse* /*response*/) { return nullptr; } - }; - typedef WithCallbackMethod_GetMembers > > > CallbackService; - typedef CallbackService ExperimentalCallbackService; - template - class WithGenericMethod_GetMembers : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_GetMembers() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_GetMembers() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetMembers(::grpc::ServerContext* /*context*/, const ::pdpb::GetMembersRequest* /*request*/, ::pdpb::GetMembersResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_GetRegion : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_GetRegion() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_GetRegion() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegion(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_GetRegionByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_GetRegionByID() { - ::grpc::Service::MarkMethodGeneric(2); - } - ~WithGenericMethod_GetRegionByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegionByID(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_GetStore : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_GetStore() { - ::grpc::Service::MarkMethodGeneric(3); - } - ~WithGenericMethod_GetStore() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetStore(::grpc::ServerContext* /*context*/, const ::pdpb::GetStoreRequest* /*request*/, ::pdpb::GetStoreResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_GetMembers : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_GetMembers() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_GetMembers() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetMembers(::grpc::ServerContext* /*context*/, const ::pdpb::GetMembersRequest* /*request*/, ::pdpb::GetMembersResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetMembers(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_GetRegion : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_GetRegion() { - ::grpc::Service::MarkMethodRaw(1); - } - ~WithRawMethod_GetRegion() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegion(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetRegion(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_GetRegionByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_GetRegionByID() { - ::grpc::Service::MarkMethodRaw(2); - } - ~WithRawMethod_GetRegionByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegionByID(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetRegionByID(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_GetStore : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_GetStore() { - ::grpc::Service::MarkMethodRaw(3); - } - ~WithRawMethod_GetStore() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetStore(::grpc::ServerContext* /*context*/, const ::pdpb::GetStoreRequest* /*request*/, ::pdpb::GetStoreResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetStore(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawCallbackMethod_GetMembers : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_GetMembers() { - ::grpc::Service::MarkMethodRawCallback(0, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetMembers(context, request, response); })); - } - ~WithRawCallbackMethod_GetMembers() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetMembers(::grpc::ServerContext* /*context*/, const ::pdpb::GetMembersRequest* /*request*/, ::pdpb::GetMembersResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetMembers( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_GetRegion : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_GetRegion() { - ::grpc::Service::MarkMethodRawCallback(1, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetRegion(context, request, response); })); - } - ~WithRawCallbackMethod_GetRegion() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegion(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetRegion( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_GetRegionByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_GetRegionByID() { - ::grpc::Service::MarkMethodRawCallback(2, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetRegionByID(context, request, response); })); - } - ~WithRawCallbackMethod_GetRegionByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetRegionByID(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetRegionByID( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_GetStore : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_GetStore() { - ::grpc::Service::MarkMethodRawCallback(3, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GetStore(context, request, response); })); - } - ~WithRawCallbackMethod_GetStore() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetStore(::grpc::ServerContext* /*context*/, const ::pdpb::GetStoreRequest* /*request*/, ::pdpb::GetStoreResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* GetStore( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithStreamedUnaryMethod_GetMembers : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_GetMembers() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< - ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::pdpb::GetMembersRequest, ::pdpb::GetMembersResponse>* streamer) { - return this->StreamedGetMembers(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_GetMembers() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status GetMembers(::grpc::ServerContext* /*context*/, const ::pdpb::GetMembersRequest* /*request*/, ::pdpb::GetMembersResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedGetMembers(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::pdpb::GetMembersRequest,::pdpb::GetMembersResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_GetRegion : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_GetRegion() { - ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::StreamedUnaryHandler< - ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>* streamer) { - return this->StreamedGetRegion(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_GetRegion() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status GetRegion(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedGetRegion(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::pdpb::GetRegionRequest,::pdpb::GetRegionResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_GetRegionByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_GetRegionByID() { - ::grpc::Service::MarkMethodStreamed(2, - new ::grpc::internal::StreamedUnaryHandler< - ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::pdpb::GetRegionRequest, ::pdpb::GetRegionResponse>* streamer) { - return this->StreamedGetRegionByID(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_GetRegionByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status GetRegionByID(::grpc::ServerContext* /*context*/, const ::pdpb::GetRegionRequest* /*request*/, ::pdpb::GetRegionResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedGetRegionByID(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::pdpb::GetRegionRequest,::pdpb::GetRegionResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_GetStore : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_GetStore() { - ::grpc::Service::MarkMethodStreamed(3, - new ::grpc::internal::StreamedUnaryHandler< - ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::pdpb::GetStoreRequest, ::pdpb::GetStoreResponse>* streamer) { - return this->StreamedGetStore(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_GetStore() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status GetStore(::grpc::ServerContext* /*context*/, const ::pdpb::GetStoreRequest* /*request*/, ::pdpb::GetStoreResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedGetStore(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::pdpb::GetStoreRequest,::pdpb::GetStoreResponse>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_GetMembers > > > StreamedUnaryService; - typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_GetMembers > > > StreamedService; -}; - -} // namespace pdpb - - -#endif // GRPC_pdpb_2eproto__INCLUDED diff --git a/ThirdParty/kvproto/generated/kvproto/pdpb.pb.cc b/ThirdParty/kvproto/generated/kvproto/pdpb.pb.cc deleted file mode 100644 index 24bc8aadf..000000000 --- a/ThirdParty/kvproto/generated/kvproto/pdpb.pb.cc +++ /dev/null @@ -1,3153 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: pdpb.proto - -#include "pdpb.pb.h" - -#include -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/extension_set.h" -#include "google/protobuf/wire_format_lite.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/reflection_ops.h" -#include "google/protobuf/wire_format.h" -#include "google/protobuf/generated_message_tctable_impl.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" -PROTOBUF_PRAGMA_INIT_SEG -namespace _pb = ::google::protobuf; -namespace _pbi = ::google::protobuf::internal; -namespace _fl = ::google::protobuf::internal::field_layout; -namespace pdpb { - -inline constexpr RequestHeader::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : cluster_id_{::uint64_t{0u}}, - sender_id_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR RequestHeader::RequestHeader(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct RequestHeaderDefaultTypeInternal { - PROTOBUF_CONSTEXPR RequestHeaderDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~RequestHeaderDefaultTypeInternal() {} - union { - RequestHeader _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RequestHeaderDefaultTypeInternal _RequestHeader_default_instance_; - -inline constexpr Member::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : peer_urls_{}, - client_urls_{}, - name_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - leader_name_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - member_id_{::uint64_t{0u}}, - leader_id_{::uint64_t{0u}}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR Member::Member(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct MemberDefaultTypeInternal { - PROTOBUF_CONSTEXPR MemberDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MemberDefaultTypeInternal() {} - union { - Member _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MemberDefaultTypeInternal _Member_default_instance_; - -inline constexpr Error::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : message_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - type_{static_cast< ::pdpb::ErrorType >(0)}, - _cached_size_{0} {} - -template -PROTOBUF_CONSTEXPR Error::Error(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct ErrorDefaultTypeInternal { - PROTOBUF_CONSTEXPR ErrorDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~ErrorDefaultTypeInternal() {} - union { - Error _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ErrorDefaultTypeInternal _Error_default_instance_; - -inline constexpr ResponseHeader::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - error_{nullptr}, - cluster_id_{::uint64_t{0u}} {} - -template -PROTOBUF_CONSTEXPR ResponseHeader::ResponseHeader(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct ResponseHeaderDefaultTypeInternal { - PROTOBUF_CONSTEXPR ResponseHeaderDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~ResponseHeaderDefaultTypeInternal() {} - union { - ResponseHeader _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_; - -inline constexpr GetStoreRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - header_{nullptr}, - store_id_{::uint64_t{0u}} {} - -template -PROTOBUF_CONSTEXPR GetStoreRequest::GetStoreRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct GetStoreRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR GetStoreRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~GetStoreRequestDefaultTypeInternal() {} - union { - GetStoreRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetStoreRequestDefaultTypeInternal _GetStoreRequest_default_instance_; - -inline constexpr GetRegionRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - region_key_( - &::google::protobuf::internal::fixed_address_empty_string, - ::_pbi::ConstantInitialized()), - header_{nullptr} {} - -template -PROTOBUF_CONSTEXPR GetRegionRequest::GetRegionRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct GetRegionRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR GetRegionRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~GetRegionRequestDefaultTypeInternal() {} - union { - GetRegionRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetRegionRequestDefaultTypeInternal _GetRegionRequest_default_instance_; - -inline constexpr GetMembersRequest::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - header_{nullptr} {} - -template -PROTOBUF_CONSTEXPR GetMembersRequest::GetMembersRequest(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct GetMembersRequestDefaultTypeInternal { - PROTOBUF_CONSTEXPR GetMembersRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~GetMembersRequestDefaultTypeInternal() {} - union { - GetMembersRequest _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetMembersRequestDefaultTypeInternal _GetMembersRequest_default_instance_; - -inline constexpr GetStoreResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - header_{nullptr}, - store_{nullptr} {} - -template -PROTOBUF_CONSTEXPR GetStoreResponse::GetStoreResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct GetStoreResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR GetStoreResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~GetStoreResponseDefaultTypeInternal() {} - union { - GetStoreResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetStoreResponseDefaultTypeInternal _GetStoreResponse_default_instance_; - -inline constexpr GetRegionResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - down_peers_{}, - pending_peers_{}, - header_{nullptr}, - region_{nullptr}, - leader_{nullptr} {} - -template -PROTOBUF_CONSTEXPR GetRegionResponse::GetRegionResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct GetRegionResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR GetRegionResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~GetRegionResponseDefaultTypeInternal() {} - union { - GetRegionResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetRegionResponseDefaultTypeInternal _GetRegionResponse_default_instance_; - -inline constexpr GetMembersResponse::Impl_::Impl_( - ::_pbi::ConstantInitialized) noexcept - : _cached_size_{0}, - members_{}, - header_{nullptr}, - leader_{nullptr}, - etcd_leader_{nullptr} {} - -template -PROTOBUF_CONSTEXPR GetMembersResponse::GetMembersResponse(::_pbi::ConstantInitialized) - : _impl_(::_pbi::ConstantInitialized()) {} -struct GetMembersResponseDefaultTypeInternal { - PROTOBUF_CONSTEXPR GetMembersResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~GetMembersResponseDefaultTypeInternal() {} - union { - GetMembersResponse _instance; - }; -}; - -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetMembersResponseDefaultTypeInternal _GetMembersResponse_default_instance_; -} // namespace pdpb -static ::_pb::Metadata file_level_metadata_pdpb_2eproto[10]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_pdpb_2eproto[1]; -static constexpr const ::_pb::ServiceDescriptor** - file_level_service_descriptors_pdpb_2eproto = nullptr; -const ::uint32_t TableStruct_pdpb_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE( - protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::pdpb::RequestHeader, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::RequestHeader, _impl_.cluster_id_), - PROTOBUF_FIELD_OFFSET(::pdpb::RequestHeader, _impl_.sender_id_), - PROTOBUF_FIELD_OFFSET(::pdpb::ResponseHeader, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::pdpb::ResponseHeader, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::ResponseHeader, _impl_.cluster_id_), - PROTOBUF_FIELD_OFFSET(::pdpb::ResponseHeader, _impl_.error_), - ~0u, - 0, - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::pdpb::Error, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::Error, _impl_.type_), - PROTOBUF_FIELD_OFFSET(::pdpb::Error, _impl_.message_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionRequest, _impl_.header_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionRequest, _impl_.region_key_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionResponse, _impl_.header_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionResponse, _impl_.region_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionResponse, _impl_.leader_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionResponse, _impl_.down_peers_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetRegionResponse, _impl_.pending_peers_), - 0, - 1, - 2, - ~0u, - ~0u, - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreRequest, _impl_.header_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreRequest, _impl_.store_id_), - 0, - ~0u, - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreResponse, _impl_.header_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetStoreResponse, _impl_.store_), - 0, - 1, - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersRequest, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersRequest, _impl_.header_), - 0, - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::pdpb::Member, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::Member, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::pdpb::Member, _impl_.member_id_), - PROTOBUF_FIELD_OFFSET(::pdpb::Member, _impl_.peer_urls_), - PROTOBUF_FIELD_OFFSET(::pdpb::Member, _impl_.client_urls_), - PROTOBUF_FIELD_OFFSET(::pdpb::Member, _impl_.leader_name_), - PROTOBUF_FIELD_OFFSET(::pdpb::Member, _impl_.leader_id_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersResponse, _impl_._has_bits_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ~0u, // no _split_ - ~0u, // no sizeof(Split) - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersResponse, _impl_.header_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersResponse, _impl_.members_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersResponse, _impl_.leader_), - PROTOBUF_FIELD_OFFSET(::pdpb::GetMembersResponse, _impl_.etcd_leader_), - 0, - ~0u, - 1, - 2, -}; - -static const ::_pbi::MigrationSchema - schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::pdpb::RequestHeader)}, - {10, 20, -1, sizeof(::pdpb::ResponseHeader)}, - {22, -1, -1, sizeof(::pdpb::Error)}, - {32, 42, -1, sizeof(::pdpb::GetRegionRequest)}, - {44, 57, -1, sizeof(::pdpb::GetRegionResponse)}, - {62, 72, -1, sizeof(::pdpb::GetStoreRequest)}, - {74, 84, -1, sizeof(::pdpb::GetStoreResponse)}, - {86, 95, -1, sizeof(::pdpb::GetMembersRequest)}, - {96, -1, -1, sizeof(::pdpb::Member)}, - {110, 122, -1, sizeof(::pdpb::GetMembersResponse)}, -}; - -static const ::_pb::Message* const file_default_instances[] = { - &::pdpb::_RequestHeader_default_instance_._instance, - &::pdpb::_ResponseHeader_default_instance_._instance, - &::pdpb::_Error_default_instance_._instance, - &::pdpb::_GetRegionRequest_default_instance_._instance, - &::pdpb::_GetRegionResponse_default_instance_._instance, - &::pdpb::_GetStoreRequest_default_instance_._instance, - &::pdpb::_GetStoreResponse_default_instance_._instance, - &::pdpb::_GetMembersRequest_default_instance_._instance, - &::pdpb::_Member_default_instance_._instance, - &::pdpb::_GetMembersResponse_default_instance_._instance, -}; -const char descriptor_table_protodef_pdpb_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\npdpb.proto\022\004pdpb\032\014metapb.proto\"6\n\rRequ" - "estHeader\022\022\n\ncluster_id\030\001 \001(\004\022\021\n\tsender_" - "id\030\002 \001(\004\"@\n\016ResponseHeader\022\022\n\ncluster_id" - "\030\001 \001(\004\022\032\n\005error\030\002 \001(\0132\013.pdpb.Error\"7\n\005Er" - "ror\022\035\n\004type\030\001 \001(\0162\017.pdpb.ErrorType\022\017\n\007me" - "ssage\030\002 \001(\t\"K\n\020GetRegionRequest\022#\n\006heade" - "r\030\001 \001(\0132\023.pdpb.RequestHeader\022\022\n\nregion_k" - "ey\030\002 \001(\014\"\276\001\n\021GetRegionResponse\022$\n\006header" - "\030\001 \001(\0132\024.pdpb.ResponseHeader\022\036\n\006region\030\002" - " \001(\0132\016.metapb.Region\022\034\n\006leader\030\003 \001(\0132\014.m" - "etapb.Peer\022 \n\ndown_peers\030\004 \003(\0132\014.metapb." - "Peer\022#\n\rpending_peers\030\005 \003(\0132\014.metapb.Pee" - "r\"H\n\017GetStoreRequest\022#\n\006header\030\001 \001(\0132\023.p" - "dpb.RequestHeader\022\020\n\010store_id\030\002 \001(\004\"V\n\020G" - "etStoreResponse\022$\n\006header\030\001 \001(\0132\024.pdpb.R" - "esponseHeader\022\034\n\005store\030\002 \001(\0132\r.metapb.St" - "ore\"8\n\021GetMembersRequest\022#\n\006header\030\001 \001(\013" - "2\023.pdpb.RequestHeader\"y\n\006Member\022\014\n\004name\030" - "\001 \001(\t\022\021\n\tmember_id\030\002 \001(\004\022\021\n\tpeer_urls\030\003 " - "\003(\t\022\023\n\013client_urls\030\004 \003(\t\022\023\n\013leader_name\030" - "\005 \001(\t\022\021\n\tleader_id\030\006 \001(\004\"\232\001\n\022GetMembersR" - "esponse\022$\n\006header\030\001 \001(\0132\024.pdpb.ResponseH" - "eader\022\035\n\007members\030\002 \003(\0132\014.pdpb.Member\022\034\n\006" - "leader\030\003 \001(\0132\014.pdpb.Member\022!\n\013etcd_leade" - "r\030\004 \001(\0132\014.pdpb.Member*\225\001\n\tErrorType\022\006\n\002O" - "K\020\000\022\013\n\007UNKNOWN\020\001\022\024\n\020NOT_BOOTSTRAPPED\020\002\022\023" - "\n\017STORE_TOMBSTONE\020\003\022\030\n\024ALREADY_BOOTSTRAP" - "PED\020\004\022\030\n\024INCOMPATIBLE_VERSION\020\005\022\024\n\020REGIO" - "N_NOT_FOUND\020\0062\210\002\n\002PD\022A\n\nGetMembers\022\027.pdp" - "b.GetMembersRequest\032\030.pdpb.GetMembersRes" - "ponse\"\000\022>\n\tGetRegion\022\026.pdpb.GetRegionReq" - "uest\032\027.pdpb.GetRegionResponse\"\000\022B\n\rGetRe" - "gionByID\022\026.pdpb.GetRegionRequest\032\027.pdpb." - "GetRegionResponse\"\000\022;\n\010GetStore\022\025.pdpb.G" - "etStoreRequest\032\026.pdpb.GetStoreResponse\"\000" - "B\022\n\020org.tikv.kvprotob\006proto3" -}; -static const ::_pbi::DescriptorTable* const descriptor_table_pdpb_2eproto_deps[1] = - { - &::descriptor_table_metapb_2eproto, -}; -static ::absl::once_flag descriptor_table_pdpb_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_pdpb_2eproto = { - false, - false, - 1428, - descriptor_table_protodef_pdpb_2eproto, - "pdpb.proto", - &descriptor_table_pdpb_2eproto_once, - descriptor_table_pdpb_2eproto_deps, - 1, - 10, - schemas, - file_default_instances, - TableStruct_pdpb_2eproto::offsets, - file_level_metadata_pdpb_2eproto, - file_level_enum_descriptors_pdpb_2eproto, - file_level_service_descriptors_pdpb_2eproto, -}; - -// This function exists to be marked as weak. -// It can significantly speed up compilation by breaking up LLVM's SCC -// in the .pb.cc translation units. Large translation units see a -// reduction of more than 35% of walltime for optimized builds. Without -// the weak attribute all the messages in the file, including all the -// vtables and everything they use become part of the same SCC through -// a cycle like: -// GetMetadata -> descriptor table -> default instances -> -// vtables -> GetMetadata -// By adding a weak function here we break the connection from the -// individual vtables back into the descriptor table. -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_pdpb_2eproto_getter() { - return &descriptor_table_pdpb_2eproto; -} -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 -static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_pdpb_2eproto(&descriptor_table_pdpb_2eproto); -namespace pdpb { -const ::google::protobuf::EnumDescriptor* ErrorType_descriptor() { - ::google::protobuf::internal::AssignDescriptors(&descriptor_table_pdpb_2eproto); - return file_level_enum_descriptors_pdpb_2eproto[0]; -} -PROTOBUF_CONSTINIT const uint32_t ErrorType_internal_data_[] = { - 458752u, 0u, }; -bool ErrorType_IsValid(int value) { - return 0 <= value && value <= 6; -} -// =================================================================== - -class RequestHeader::_Internal { - public: -}; - -RequestHeader::RequestHeader(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.RequestHeader) -} -RequestHeader::RequestHeader( - ::google::protobuf::Arena* arena, const RequestHeader& from) - : RequestHeader(arena) { - MergeFrom(from); -} -inline PROTOBUF_NDEBUG_INLINE RequestHeader::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void RequestHeader::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, cluster_id_), - 0, - offsetof(Impl_, sender_id_) - - offsetof(Impl_, cluster_id_) + - sizeof(Impl_::sender_id_)); -} -RequestHeader::~RequestHeader() { - // @@protoc_insertion_point(destructor:pdpb.RequestHeader) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void RequestHeader::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void RequestHeader::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.RequestHeader) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&_impl_.cluster_id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.sender_id_) - - reinterpret_cast(&_impl_.cluster_id_)) + sizeof(_impl_.sender_id_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* RequestHeader::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 0, 2> RequestHeader::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_RequestHeader_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 sender_id = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RequestHeader, _impl_.sender_id_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.sender_id_)}}, - // uint64 cluster_id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(RequestHeader, _impl_.cluster_id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.cluster_id_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 cluster_id = 1; - {PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.cluster_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // uint64 sender_id = 2; - {PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.sender_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - }}, -}; - -::uint8_t* RequestHeader::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.RequestHeader) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 cluster_id = 1; - if (this->_internal_cluster_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_cluster_id(), target); - } - - // uint64 sender_id = 2; - if (this->_internal_sender_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_sender_id(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.RequestHeader) - return target; -} - -::size_t RequestHeader::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.RequestHeader) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 cluster_id = 1; - if (this->_internal_cluster_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_cluster_id()); - } - - // uint64 sender_id = 2; - if (this->_internal_sender_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_sender_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData RequestHeader::_class_data_ = { - RequestHeader::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* RequestHeader::GetClassData() const { - return &_class_data_; -} - -void RequestHeader::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.RequestHeader) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (from._internal_cluster_id() != 0) { - _this->_internal_set_cluster_id(from._internal_cluster_id()); - } - if (from._internal_sender_id() != 0) { - _this->_internal_set_sender_id(from._internal_sender_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void RequestHeader::CopyFrom(const RequestHeader& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.RequestHeader) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool RequestHeader::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* RequestHeader::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void RequestHeader::InternalSwap(RequestHeader* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.sender_id_) - + sizeof(RequestHeader::_impl_.sender_id_) - - PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.cluster_id_)>( - reinterpret_cast(&_impl_.cluster_id_), - reinterpret_cast(&other->_impl_.cluster_id_)); -} - -::google::protobuf::Metadata RequestHeader::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[0]); -} -// =================================================================== - -class ResponseHeader::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_._has_bits_); - static const ::pdpb::Error& error(const ResponseHeader* msg); - static void set_has_error(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::pdpb::Error& ResponseHeader::_Internal::error(const ResponseHeader* msg) { - return *msg->_impl_.error_; -} -ResponseHeader::ResponseHeader(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.ResponseHeader) -} -inline PROTOBUF_NDEBUG_INLINE ResponseHeader::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0} {} - -ResponseHeader::ResponseHeader( - ::google::protobuf::Arena* arena, - const ResponseHeader& from) - : ::google::protobuf::Message(arena) { - ResponseHeader* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.error_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::pdpb::Error>(arena, *from._impl_.error_) - : nullptr; - _impl_.cluster_id_ = from._impl_.cluster_id_; - - // @@protoc_insertion_point(copy_constructor:pdpb.ResponseHeader) -} -inline PROTOBUF_NDEBUG_INLINE ResponseHeader::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void ResponseHeader::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, error_), - 0, - offsetof(Impl_, cluster_id_) - - offsetof(Impl_, error_) + - sizeof(Impl_::cluster_id_)); -} -ResponseHeader::~ResponseHeader() { - // @@protoc_insertion_point(destructor:pdpb.ResponseHeader) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void ResponseHeader::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.error_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void ResponseHeader::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.ResponseHeader) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.error_ != nullptr); - _impl_.error_->Clear(); - } - _impl_.cluster_id_ = ::uint64_t{0u}; - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* ResponseHeader::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> ResponseHeader::_table_ = { - { - PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_ResponseHeader_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // .pdpb.Error error = 2; - {::_pbi::TcParser::FastMtS1, - {18, 0, 0, PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_.error_)}}, - // uint64 cluster_id = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ResponseHeader, _impl_.cluster_id_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_.cluster_id_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // uint64 cluster_id = 1; - {PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_.cluster_id_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // .pdpb.Error error = 2; - {PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_.error_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::pdpb::Error>()}, - }}, {{ - }}, -}; - -::uint8_t* ResponseHeader::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.ResponseHeader) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // uint64 cluster_id = 1; - if (this->_internal_cluster_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 1, this->_internal_cluster_id(), target); - } - - cached_has_bits = _impl_._has_bits_[0]; - // .pdpb.Error error = 2; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 2, _Internal::error(this), - _Internal::error(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.ResponseHeader) - return target; -} - -::size_t ResponseHeader::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.ResponseHeader) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .pdpb.Error error = 2; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.error_); - } - - // uint64 cluster_id = 1; - if (this->_internal_cluster_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_cluster_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData ResponseHeader::_class_data_ = { - ResponseHeader::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* ResponseHeader::GetClassData() const { - return &_class_data_; -} - -void ResponseHeader::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.ResponseHeader) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_error()->::pdpb::Error::MergeFrom( - from._internal_error()); - } - if (from._internal_cluster_id() != 0) { - _this->_internal_set_cluster_id(from._internal_cluster_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void ResponseHeader::CopyFrom(const ResponseHeader& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.ResponseHeader) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool ResponseHeader::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* ResponseHeader::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void ResponseHeader::InternalSwap(ResponseHeader* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_.cluster_id_) - + sizeof(ResponseHeader::_impl_.cluster_id_) - - PROTOBUF_FIELD_OFFSET(ResponseHeader, _impl_.error_)>( - reinterpret_cast(&_impl_.error_), - reinterpret_cast(&other->_impl_.error_)); -} - -::google::protobuf::Metadata ResponseHeader::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[1]); -} -// =================================================================== - -class Error::_Internal { - public: -}; - -Error::Error(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.Error) -} -inline PROTOBUF_NDEBUG_INLINE Error::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : message_(arena, from.message_), - _cached_size_{0} {} - -Error::Error( - ::google::protobuf::Arena* arena, - const Error& from) - : ::google::protobuf::Message(arena) { - Error* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - _impl_.type_ = from._impl_.type_; - - // @@protoc_insertion_point(copy_constructor:pdpb.Error) -} -inline PROTOBUF_NDEBUG_INLINE Error::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : message_(arena), - _cached_size_{0} {} - -inline void Error::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.type_ = {}; -} -Error::~Error() { - // @@protoc_insertion_point(destructor:pdpb.Error) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Error::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.message_.Destroy(); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Error::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.Error) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.message_.ClearToEmpty(); - _impl_.type_ = 0; - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Error::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 26, 2> Error::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_Error_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // string message = 2; - {::_pbi::TcParser::FastUS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(Error, _impl_.message_)}}, - // .pdpb.ErrorType type = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Error, _impl_.type_), 63>(), - {8, 63, 0, PROTOBUF_FIELD_OFFSET(Error, _impl_.type_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .pdpb.ErrorType type = 1; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.type_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, - // string message = 2; - {PROTOBUF_FIELD_OFFSET(Error, _impl_.message_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - }}, - // no aux_entries - {{ - "\12\0\7\0\0\0\0\0" - "pdpb.Error" - "message" - }}, -}; - -::uint8_t* Error::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.Error) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // .pdpb.ErrorType type = 1; - if (this->_internal_type() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 1, this->_internal_type(), target); - } - - // string message = 2; - if (!this->_internal_message().empty()) { - const std::string& _s = this->_internal_message(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "pdpb.Error.message"); - target = stream->WriteStringMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.Error) - return target; -} - -::size_t Error::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.Error) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string message = 2; - if (!this->_internal_message().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_message()); - } - - // .pdpb.ErrorType type = 1; - if (this->_internal_type() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Error::_class_data_ = { - Error::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Error::GetClassData() const { - return &_class_data_; -} - -void Error::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.Error) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_message().empty()) { - _this->_internal_set_message(from._internal_message()); - } - if (from._internal_type() != 0) { - _this->_internal_set_type(from._internal_type()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Error::CopyFrom(const Error& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.Error) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Error::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Error::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Error::InternalSwap(Error* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.message_, &other->_impl_.message_, arena); - swap(_impl_.type_, other->_impl_.type_); -} - -::google::protobuf::Metadata Error::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[2]); -} -// =================================================================== - -class GetRegionRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(GetRegionRequest, _impl_._has_bits_); - static const ::pdpb::RequestHeader& header(const GetRegionRequest* msg); - static void set_has_header(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::pdpb::RequestHeader& GetRegionRequest::_Internal::header(const GetRegionRequest* msg) { - return *msg->_impl_.header_; -} -GetRegionRequest::GetRegionRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.GetRegionRequest) -} -inline PROTOBUF_NDEBUG_INLINE GetRegionRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - region_key_(arena, from.region_key_) {} - -GetRegionRequest::GetRegionRequest( - ::google::protobuf::Arena* arena, - const GetRegionRequest& from) - : ::google::protobuf::Message(arena) { - GetRegionRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.header_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::pdpb::RequestHeader>(arena, *from._impl_.header_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:pdpb.GetRegionRequest) -} -inline PROTOBUF_NDEBUG_INLINE GetRegionRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - region_key_(arena) {} - -inline void GetRegionRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.header_ = {}; -} -GetRegionRequest::~GetRegionRequest() { - // @@protoc_insertion_point(destructor:pdpb.GetRegionRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void GetRegionRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.region_key_.Destroy(); - delete _impl_.header_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void GetRegionRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.GetRegionRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.region_key_.ClearToEmpty(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.header_ != nullptr); - _impl_.header_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* GetRegionRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> GetRegionRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(GetRegionRequest, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_GetRegionRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // bytes region_key = 2; - {::_pbi::TcParser::FastBS1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(GetRegionRequest, _impl_.region_key_)}}, - // .pdpb.RequestHeader header = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(GetRegionRequest, _impl_.header_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .pdpb.RequestHeader header = 1; - {PROTOBUF_FIELD_OFFSET(GetRegionRequest, _impl_.header_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // bytes region_key = 2; - {PROTOBUF_FIELD_OFFSET(GetRegionRequest, _impl_.region_key_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, - }}, {{ - {::_pbi::TcParser::GetTable<::pdpb::RequestHeader>()}, - }}, {{ - }}, -}; - -::uint8_t* GetRegionRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.GetRegionRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .pdpb.RequestHeader header = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::header(this), - _Internal::header(this).GetCachedSize(), target, stream); - } - - // bytes region_key = 2; - if (!this->_internal_region_key().empty()) { - const std::string& _s = this->_internal_region_key(); - target = stream->WriteBytesMaybeAliased(2, _s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.GetRegionRequest) - return target; -} - -::size_t GetRegionRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.GetRegionRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes region_key = 2; - if (!this->_internal_region_key().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( - this->_internal_region_key()); - } - - // .pdpb.RequestHeader header = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.header_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData GetRegionRequest::_class_data_ = { - GetRegionRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* GetRegionRequest::GetClassData() const { - return &_class_data_; -} - -void GetRegionRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.GetRegionRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if (!from._internal_region_key().empty()) { - _this->_internal_set_region_key(from._internal_region_key()); - } - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_header()->::pdpb::RequestHeader::MergeFrom( - from._internal_header()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void GetRegionRequest::CopyFrom(const GetRegionRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.GetRegionRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool GetRegionRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* GetRegionRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void GetRegionRequest::InternalSwap(GetRegionRequest* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.region_key_, &other->_impl_.region_key_, arena); - swap(_impl_.header_, other->_impl_.header_); -} - -::google::protobuf::Metadata GetRegionRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[3]); -} -// =================================================================== - -class GetRegionResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_._has_bits_); - static const ::pdpb::ResponseHeader& header(const GetRegionResponse* msg); - static void set_has_header(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::metapb::Region& region(const GetRegionResponse* msg); - static void set_has_region(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static const ::metapb::Peer& leader(const GetRegionResponse* msg); - static void set_has_leader(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } -}; - -const ::pdpb::ResponseHeader& GetRegionResponse::_Internal::header(const GetRegionResponse* msg) { - return *msg->_impl_.header_; -} -const ::metapb::Region& GetRegionResponse::_Internal::region(const GetRegionResponse* msg) { - return *msg->_impl_.region_; -} -const ::metapb::Peer& GetRegionResponse::_Internal::leader(const GetRegionResponse* msg) { - return *msg->_impl_.leader_; -} -void GetRegionResponse::clear_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.region_ != nullptr) _impl_.region_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -void GetRegionResponse::clear_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.leader_ != nullptr) _impl_.leader_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; -} -void GetRegionResponse::clear_down_peers() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.down_peers_.Clear(); -} -void GetRegionResponse::clear_pending_peers() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.pending_peers_.Clear(); -} -GetRegionResponse::GetRegionResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.GetRegionResponse) -} -inline PROTOBUF_NDEBUG_INLINE GetRegionResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - down_peers_{visibility, arena, from.down_peers_}, - pending_peers_{visibility, arena, from.pending_peers_} {} - -GetRegionResponse::GetRegionResponse( - ::google::protobuf::Arena* arena, - const GetRegionResponse& from) - : ::google::protobuf::Message(arena) { - GetRegionResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.header_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::pdpb::ResponseHeader>(arena, *from._impl_.header_) - : nullptr; - _impl_.region_ = (cached_has_bits & 0x00000002u) - ? CreateMaybeMessage<::metapb::Region>(arena, *from._impl_.region_) - : nullptr; - _impl_.leader_ = (cached_has_bits & 0x00000004u) - ? CreateMaybeMessage<::metapb::Peer>(arena, *from._impl_.leader_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:pdpb.GetRegionResponse) -} -inline PROTOBUF_NDEBUG_INLINE GetRegionResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - down_peers_{visibility, arena}, - pending_peers_{visibility, arena} {} - -inline void GetRegionResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, header_), - 0, - offsetof(Impl_, leader_) - - offsetof(Impl_, header_) + - sizeof(Impl_::leader_)); -} -GetRegionResponse::~GetRegionResponse() { - // @@protoc_insertion_point(destructor:pdpb.GetRegionResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void GetRegionResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.header_; - delete _impl_.region_; - delete _impl_.leader_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void GetRegionResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.GetRegionResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.down_peers_.Clear(); - _impl_.pending_peers_.Clear(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.header_ != nullptr); - _impl_.header_->Clear(); - } - if (cached_has_bits & 0x00000002u) { - ABSL_DCHECK(_impl_.region_ != nullptr); - _impl_.region_->Clear(); - } - if (cached_has_bits & 0x00000004u) { - ABSL_DCHECK(_impl_.leader_ != nullptr); - _impl_.leader_->Clear(); - } - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* GetRegionResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 5, 5, 0, 2> GetRegionResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_._has_bits_), - 0, // no _extensions_ - 5, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967264, // skipmap - offsetof(decltype(_table_), field_entries), - 5, // num_field_entries - 5, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_GetRegionResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // .pdpb.ResponseHeader header = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.header_)}}, - // .metapb.Region region = 2; - {::_pbi::TcParser::FastMtS1, - {18, 1, 1, PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.region_)}}, - // .metapb.Peer leader = 3; - {::_pbi::TcParser::FastMtS1, - {26, 2, 2, PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.leader_)}}, - // repeated .metapb.Peer down_peers = 4; - {::_pbi::TcParser::FastMtR1, - {34, 63, 3, PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.down_peers_)}}, - // repeated .metapb.Peer pending_peers = 5; - {::_pbi::TcParser::FastMtR1, - {42, 63, 4, PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.pending_peers_)}}, - {::_pbi::TcParser::MiniParse, {}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // .pdpb.ResponseHeader header = 1; - {PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.header_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .metapb.Region region = 2; - {PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.region_), _Internal::kHasBitsOffset + 1, 1, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .metapb.Peer leader = 3; - {PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.leader_), _Internal::kHasBitsOffset + 2, 2, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated .metapb.Peer down_peers = 4; - {PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.down_peers_), -1, 3, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated .metapb.Peer pending_peers = 5; - {PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.pending_peers_), -1, 4, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::pdpb::ResponseHeader>()}, - {::_pbi::TcParser::GetTable<::metapb::Region>()}, - {::_pbi::TcParser::GetTable<::metapb::Peer>()}, - {::_pbi::TcParser::GetTable<::metapb::Peer>()}, - {::_pbi::TcParser::GetTable<::metapb::Peer>()}, - }}, {{ - }}, -}; - -::uint8_t* GetRegionResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.GetRegionResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .pdpb.ResponseHeader header = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::header(this), - _Internal::header(this).GetCachedSize(), target, stream); - } - - // .metapb.Region region = 2; - if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 2, _Internal::region(this), - _Internal::region(this).GetCachedSize(), target, stream); - } - - // .metapb.Peer leader = 3; - if (cached_has_bits & 0x00000004u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 3, _Internal::leader(this), - _Internal::leader(this).GetCachedSize(), target, stream); - } - - // repeated .metapb.Peer down_peers = 4; - for (unsigned i = 0, - n = static_cast(this->_internal_down_peers_size()); i < n; i++) { - const auto& repfield = this->_internal_down_peers().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); - } - - // repeated .metapb.Peer pending_peers = 5; - for (unsigned i = 0, - n = static_cast(this->_internal_pending_peers_size()); i < n; i++) { - const auto& repfield = this->_internal_pending_peers().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.GetRegionResponse) - return target; -} - -::size_t GetRegionResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.GetRegionResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .metapb.Peer down_peers = 4; - total_size += 1UL * this->_internal_down_peers_size(); - for (const auto& msg : this->_internal_down_peers()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - // repeated .metapb.Peer pending_peers = 5; - total_size += 1UL * this->_internal_pending_peers_size(); - for (const auto& msg : this->_internal_pending_peers()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // .pdpb.ResponseHeader header = 1; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.header_); - } - - // .metapb.Region region = 2; - if (cached_has_bits & 0x00000002u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.region_); - } - - // .metapb.Peer leader = 3; - if (cached_has_bits & 0x00000004u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.leader_); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData GetRegionResponse::_class_data_ = { - GetRegionResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* GetRegionResponse::GetClassData() const { - return &_class_data_; -} - -void GetRegionResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.GetRegionResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_down_peers()->MergeFrom( - from._internal_down_peers()); - _this->_internal_mutable_pending_peers()->MergeFrom( - from._internal_pending_peers()); - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_header()->::pdpb::ResponseHeader::MergeFrom( - from._internal_header()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_region()->::metapb::Region::MergeFrom( - from._internal_region()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_leader()->::metapb::Peer::MergeFrom( - from._internal_leader()); - } - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void GetRegionResponse::CopyFrom(const GetRegionResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.GetRegionResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool GetRegionResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* GetRegionResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void GetRegionResponse::InternalSwap(GetRegionResponse* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.down_peers_.InternalSwap(&other->_impl_.down_peers_); - _impl_.pending_peers_.InternalSwap(&other->_impl_.pending_peers_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.leader_) - + sizeof(GetRegionResponse::_impl_.leader_) - - PROTOBUF_FIELD_OFFSET(GetRegionResponse, _impl_.header_)>( - reinterpret_cast(&_impl_.header_), - reinterpret_cast(&other->_impl_.header_)); -} - -::google::protobuf::Metadata GetRegionResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[4]); -} -// =================================================================== - -class GetStoreRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_._has_bits_); - static const ::pdpb::RequestHeader& header(const GetStoreRequest* msg); - static void set_has_header(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::pdpb::RequestHeader& GetStoreRequest::_Internal::header(const GetStoreRequest* msg) { - return *msg->_impl_.header_; -} -GetStoreRequest::GetStoreRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.GetStoreRequest) -} -inline PROTOBUF_NDEBUG_INLINE GetStoreRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0} {} - -GetStoreRequest::GetStoreRequest( - ::google::protobuf::Arena* arena, - const GetStoreRequest& from) - : ::google::protobuf::Message(arena) { - GetStoreRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.header_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::pdpb::RequestHeader>(arena, *from._impl_.header_) - : nullptr; - _impl_.store_id_ = from._impl_.store_id_; - - // @@protoc_insertion_point(copy_constructor:pdpb.GetStoreRequest) -} -inline PROTOBUF_NDEBUG_INLINE GetStoreRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void GetStoreRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, header_), - 0, - offsetof(Impl_, store_id_) - - offsetof(Impl_, header_) + - sizeof(Impl_::store_id_)); -} -GetStoreRequest::~GetStoreRequest() { - // @@protoc_insertion_point(destructor:pdpb.GetStoreRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void GetStoreRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.header_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void GetStoreRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.GetStoreRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.header_ != nullptr); - _impl_.header_->Clear(); - } - _impl_.store_id_ = ::uint64_t{0u}; - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* GetStoreRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> GetStoreRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_GetStoreRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // uint64 store_id = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(GetStoreRequest, _impl_.store_id_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_.store_id_)}}, - // .pdpb.RequestHeader header = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_.header_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .pdpb.RequestHeader header = 1; - {PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_.header_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // uint64 store_id = 2; - {PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_.store_id_), -1, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, {{ - {::_pbi::TcParser::GetTable<::pdpb::RequestHeader>()}, - }}, {{ - }}, -}; - -::uint8_t* GetStoreRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.GetStoreRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .pdpb.RequestHeader header = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::header(this), - _Internal::header(this).GetCachedSize(), target, stream); - } - - // uint64 store_id = 2; - if (this->_internal_store_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_store_id(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.GetStoreRequest) - return target; -} - -::size_t GetStoreRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.GetStoreRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .pdpb.RequestHeader header = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.header_); - } - - // uint64 store_id = 2; - if (this->_internal_store_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_store_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData GetStoreRequest::_class_data_ = { - GetStoreRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* GetStoreRequest::GetClassData() const { - return &_class_data_; -} - -void GetStoreRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.GetStoreRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_header()->::pdpb::RequestHeader::MergeFrom( - from._internal_header()); - } - if (from._internal_store_id() != 0) { - _this->_internal_set_store_id(from._internal_store_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void GetStoreRequest::CopyFrom(const GetStoreRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.GetStoreRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool GetStoreRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* GetStoreRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void GetStoreRequest::InternalSwap(GetStoreRequest* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_.store_id_) - + sizeof(GetStoreRequest::_impl_.store_id_) - - PROTOBUF_FIELD_OFFSET(GetStoreRequest, _impl_.header_)>( - reinterpret_cast(&_impl_.header_), - reinterpret_cast(&other->_impl_.header_)); -} - -::google::protobuf::Metadata GetStoreRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[5]); -} -// =================================================================== - -class GetStoreResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_._has_bits_); - static const ::pdpb::ResponseHeader& header(const GetStoreResponse* msg); - static void set_has_header(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::metapb::Store& store(const GetStoreResponse* msg); - static void set_has_store(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } -}; - -const ::pdpb::ResponseHeader& GetStoreResponse::_Internal::header(const GetStoreResponse* msg) { - return *msg->_impl_.header_; -} -const ::metapb::Store& GetStoreResponse::_Internal::store(const GetStoreResponse* msg) { - return *msg->_impl_.store_; -} -void GetStoreResponse::clear_store() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.store_ != nullptr) _impl_.store_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -GetStoreResponse::GetStoreResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.GetStoreResponse) -} -inline PROTOBUF_NDEBUG_INLINE GetStoreResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0} {} - -GetStoreResponse::GetStoreResponse( - ::google::protobuf::Arena* arena, - const GetStoreResponse& from) - : ::google::protobuf::Message(arena) { - GetStoreResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.header_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::pdpb::ResponseHeader>(arena, *from._impl_.header_) - : nullptr; - _impl_.store_ = (cached_has_bits & 0x00000002u) - ? CreateMaybeMessage<::metapb::Store>(arena, *from._impl_.store_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:pdpb.GetStoreResponse) -} -inline PROTOBUF_NDEBUG_INLINE GetStoreResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void GetStoreResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, header_), - 0, - offsetof(Impl_, store_) - - offsetof(Impl_, header_) + - sizeof(Impl_::store_)); -} -GetStoreResponse::~GetStoreResponse() { - // @@protoc_insertion_point(destructor:pdpb.GetStoreResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void GetStoreResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.header_; - delete _impl_.store_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void GetStoreResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.GetStoreResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.header_ != nullptr); - _impl_.header_->Clear(); - } - if (cached_has_bits & 0x00000002u) { - ABSL_DCHECK(_impl_.store_ != nullptr); - _impl_.store_->Clear(); - } - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* GetStoreResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 2, 0, 2> GetStoreResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_._has_bits_), - 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap - offsetof(decltype(_table_), field_entries), - 2, // num_field_entries - 2, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_GetStoreResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // .metapb.Store store = 2; - {::_pbi::TcParser::FastMtS1, - {18, 1, 1, PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_.store_)}}, - // .pdpb.ResponseHeader header = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_.header_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .pdpb.ResponseHeader header = 1; - {PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_.header_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .metapb.Store store = 2; - {PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_.store_), _Internal::kHasBitsOffset + 1, 1, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::pdpb::ResponseHeader>()}, - {::_pbi::TcParser::GetTable<::metapb::Store>()}, - }}, {{ - }}, -}; - -::uint8_t* GetStoreResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.GetStoreResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .pdpb.ResponseHeader header = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::header(this), - _Internal::header(this).GetCachedSize(), target, stream); - } - - // .metapb.Store store = 2; - if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 2, _Internal::store(this), - _Internal::store(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.GetStoreResponse) - return target; -} - -::size_t GetStoreResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.GetStoreResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - // .pdpb.ResponseHeader header = 1; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.header_); - } - - // .metapb.Store store = 2; - if (cached_has_bits & 0x00000002u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.store_); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData GetStoreResponse::_class_data_ = { - GetStoreResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* GetStoreResponse::GetClassData() const { - return &_class_data_; -} - -void GetStoreResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.GetStoreResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000003u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_header()->::pdpb::ResponseHeader::MergeFrom( - from._internal_header()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_store()->::metapb::Store::MergeFrom( - from._internal_store()); - } - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void GetStoreResponse::CopyFrom(const GetStoreResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.GetStoreResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool GetStoreResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* GetStoreResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void GetStoreResponse::InternalSwap(GetStoreResponse* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_.store_) - + sizeof(GetStoreResponse::_impl_.store_) - - PROTOBUF_FIELD_OFFSET(GetStoreResponse, _impl_.header_)>( - reinterpret_cast(&_impl_.header_), - reinterpret_cast(&other->_impl_.header_)); -} - -::google::protobuf::Metadata GetStoreResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[6]); -} -// =================================================================== - -class GetMembersRequest::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(GetMembersRequest, _impl_._has_bits_); - static const ::pdpb::RequestHeader& header(const GetMembersRequest* msg); - static void set_has_header(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } -}; - -const ::pdpb::RequestHeader& GetMembersRequest::_Internal::header(const GetMembersRequest* msg) { - return *msg->_impl_.header_; -} -GetMembersRequest::GetMembersRequest(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.GetMembersRequest) -} -inline PROTOBUF_NDEBUG_INLINE GetMembersRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0} {} - -GetMembersRequest::GetMembersRequest( - ::google::protobuf::Arena* arena, - const GetMembersRequest& from) - : ::google::protobuf::Message(arena) { - GetMembersRequest* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.header_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::pdpb::RequestHeader>(arena, *from._impl_.header_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:pdpb.GetMembersRequest) -} -inline PROTOBUF_NDEBUG_INLINE GetMembersRequest::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0} {} - -inline void GetMembersRequest::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - _impl_.header_ = {}; -} -GetMembersRequest::~GetMembersRequest() { - // @@protoc_insertion_point(destructor:pdpb.GetMembersRequest) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void GetMembersRequest::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.header_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void GetMembersRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.GetMembersRequest) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.header_ != nullptr); - _impl_.header_->Clear(); - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* GetMembersRequest::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 1, 1, 0, 2> GetMembersRequest::_table_ = { - { - PROTOBUF_FIELD_OFFSET(GetMembersRequest, _impl_._has_bits_), - 0, // no _extensions_ - 1, 0, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967294, // skipmap - offsetof(decltype(_table_), field_entries), - 1, // num_field_entries - 1, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_GetMembersRequest_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // .pdpb.RequestHeader header = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(GetMembersRequest, _impl_.header_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .pdpb.RequestHeader header = 1; - {PROTOBUF_FIELD_OFFSET(GetMembersRequest, _impl_.header_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::pdpb::RequestHeader>()}, - }}, {{ - }}, -}; - -::uint8_t* GetMembersRequest::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.GetMembersRequest) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .pdpb.RequestHeader header = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::header(this), - _Internal::header(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.GetMembersRequest) - return target; -} - -::size_t GetMembersRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.GetMembersRequest) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .pdpb.RequestHeader header = 1; - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.header_); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData GetMembersRequest::_class_data_ = { - GetMembersRequest::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* GetMembersRequest::GetClassData() const { - return &_class_data_; -} - -void GetMembersRequest::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.GetMembersRequest) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) { - _this->_internal_mutable_header()->::pdpb::RequestHeader::MergeFrom( - from._internal_header()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void GetMembersRequest::CopyFrom(const GetMembersRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.GetMembersRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool GetMembersRequest::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* GetMembersRequest::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void GetMembersRequest::InternalSwap(GetMembersRequest* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - swap(_impl_.header_, other->_impl_.header_); -} - -::google::protobuf::Metadata GetMembersRequest::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[7]); -} -// =================================================================== - -class Member::_Internal { - public: -}; - -Member::Member(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.Member) -} -inline PROTOBUF_NDEBUG_INLINE Member::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : peer_urls_{visibility, arena, from.peer_urls_}, - client_urls_{visibility, arena, from.client_urls_}, - name_(arena, from.name_), - leader_name_(arena, from.leader_name_), - _cached_size_{0} {} - -Member::Member( - ::google::protobuf::Arena* arena, - const Member& from) - : ::google::protobuf::Message(arena) { - Member* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::memcpy(reinterpret_cast(&_impl_) + - offsetof(Impl_, member_id_), - reinterpret_cast(&from._impl_) + - offsetof(Impl_, member_id_), - offsetof(Impl_, leader_id_) - - offsetof(Impl_, member_id_) + - sizeof(Impl_::leader_id_)); - - // @@protoc_insertion_point(copy_constructor:pdpb.Member) -} -inline PROTOBUF_NDEBUG_INLINE Member::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : peer_urls_{visibility, arena}, - client_urls_{visibility, arena}, - name_(arena), - leader_name_(arena), - _cached_size_{0} {} - -inline void Member::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, member_id_), - 0, - offsetof(Impl_, leader_id_) - - offsetof(Impl_, member_id_) + - sizeof(Impl_::leader_id_)); -} -Member::~Member() { - // @@protoc_insertion_point(destructor:pdpb.Member) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void Member::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - _impl_.name_.Destroy(); - _impl_.leader_name_.Destroy(); - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void Member::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.Member) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.peer_urls_.Clear(); - _impl_.client_urls_.Clear(); - _impl_.name_.ClearToEmpty(); - _impl_.leader_name_.ClearToEmpty(); - ::memset(&_impl_.member_id_, 0, static_cast<::size_t>( - reinterpret_cast(&_impl_.leader_id_) - - reinterpret_cast(&_impl_.member_id_)) + sizeof(_impl_.leader_id_)); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* Member::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<3, 6, 0, 55, 2> Member::_table_ = { - { - 0, // no _has_bits_ - 0, // no _extensions_ - 6, 56, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967232, // skipmap - offsetof(decltype(_table_), field_entries), - 6, // num_field_entries - 0, // num_aux_entries - offsetof(decltype(_table_), field_names), // no aux_entries - &_Member_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - {::_pbi::TcParser::MiniParse, {}}, - // string name = 1; - {::_pbi::TcParser::FastUS1, - {10, 63, 0, PROTOBUF_FIELD_OFFSET(Member, _impl_.name_)}}, - // uint64 member_id = 2; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Member, _impl_.member_id_), 63>(), - {16, 63, 0, PROTOBUF_FIELD_OFFSET(Member, _impl_.member_id_)}}, - // repeated string peer_urls = 3; - {::_pbi::TcParser::FastUR1, - {26, 63, 0, PROTOBUF_FIELD_OFFSET(Member, _impl_.peer_urls_)}}, - // repeated string client_urls = 4; - {::_pbi::TcParser::FastUR1, - {34, 63, 0, PROTOBUF_FIELD_OFFSET(Member, _impl_.client_urls_)}}, - // string leader_name = 5; - {::_pbi::TcParser::FastUS1, - {42, 63, 0, PROTOBUF_FIELD_OFFSET(Member, _impl_.leader_name_)}}, - // uint64 leader_id = 6; - {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Member, _impl_.leader_id_), 63>(), - {48, 63, 0, PROTOBUF_FIELD_OFFSET(Member, _impl_.leader_id_)}}, - {::_pbi::TcParser::MiniParse, {}}, - }}, {{ - 65535, 65535 - }}, {{ - // string name = 1; - {PROTOBUF_FIELD_OFFSET(Member, _impl_.name_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint64 member_id = 2; - {PROTOBUF_FIELD_OFFSET(Member, _impl_.member_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - // repeated string peer_urls = 3; - {PROTOBUF_FIELD_OFFSET(Member, _impl_.peer_urls_), 0, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kUtf8String | ::_fl::kRepSString)}, - // repeated string client_urls = 4; - {PROTOBUF_FIELD_OFFSET(Member, _impl_.client_urls_), 0, 0, - (0 | ::_fl::kFcRepeated | ::_fl::kUtf8String | ::_fl::kRepSString)}, - // string leader_name = 5; - {PROTOBUF_FIELD_OFFSET(Member, _impl_.leader_name_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // uint64 leader_id = 6; - {PROTOBUF_FIELD_OFFSET(Member, _impl_.leader_id_), 0, 0, - (0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, - }}, - // no aux_entries - {{ - "\13\4\0\11\13\13\0\0" - "pdpb.Member" - "name" - "peer_urls" - "client_urls" - "leader_name" - }}, -}; - -::uint8_t* Member::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.Member) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - // string name = 1; - if (!this->_internal_name().empty()) { - const std::string& _s = this->_internal_name(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "pdpb.Member.name"); - target = stream->WriteStringMaybeAliased(1, _s, target); - } - - // uint64 member_id = 2; - if (this->_internal_member_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 2, this->_internal_member_id(), target); - } - - // repeated string peer_urls = 3; - for (int i = 0, n = this->_internal_peer_urls_size(); i < n; ++i) { - const auto& s = this->_internal_peer_urls().Get(i); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - s.data(), static_cast(s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "pdpb.Member.peer_urls"); - target = stream->WriteString(3, s, target); - } - - // repeated string client_urls = 4; - for (int i = 0, n = this->_internal_client_urls_size(); i < n; ++i) { - const auto& s = this->_internal_client_urls().Get(i); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - s.data(), static_cast(s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "pdpb.Member.client_urls"); - target = stream->WriteString(4, s, target); - } - - // string leader_name = 5; - if (!this->_internal_leader_name().empty()) { - const std::string& _s = this->_internal_leader_name(); - ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( - _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "pdpb.Member.leader_name"); - target = stream->WriteStringMaybeAliased(5, _s, target); - } - - // uint64 leader_id = 6; - if (this->_internal_leader_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray( - 6, this->_internal_leader_id(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.Member) - return target; -} - -::size_t Member::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.Member) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string peer_urls = 3; - total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_peer_urls().size()); - for (int i = 0, n = _internal_peer_urls().size(); i < n; ++i) { - total_size += ::google::protobuf::internal::WireFormatLite::StringSize( - _internal_peer_urls().Get(i)); - } - // repeated string client_urls = 4; - total_size += 1 * ::google::protobuf::internal::FromIntSize(_internal_client_urls().size()); - for (int i = 0, n = _internal_client_urls().size(); i < n; ++i) { - total_size += ::google::protobuf::internal::WireFormatLite::StringSize( - _internal_client_urls().Get(i)); - } - // string name = 1; - if (!this->_internal_name().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // string leader_name = 5; - if (!this->_internal_leader_name().empty()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->_internal_leader_name()); - } - - // uint64 member_id = 2; - if (this->_internal_member_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_member_id()); - } - - // uint64 leader_id = 6; - if (this->_internal_leader_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( - this->_internal_leader_id()); - } - - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData Member::_class_data_ = { - Member::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* Member::GetClassData() const { - return &_class_data_; -} - -void Member::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.Member) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_peer_urls()->MergeFrom(from._internal_peer_urls()); - _this->_internal_mutable_client_urls()->MergeFrom(from._internal_client_urls()); - if (!from._internal_name().empty()) { - _this->_internal_set_name(from._internal_name()); - } - if (!from._internal_leader_name().empty()) { - _this->_internal_set_leader_name(from._internal_leader_name()); - } - if (from._internal_member_id() != 0) { - _this->_internal_set_member_id(from._internal_member_id()); - } - if (from._internal_leader_id() != 0) { - _this->_internal_set_leader_id(from._internal_leader_id()); - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void Member::CopyFrom(const Member& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.Member) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool Member::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* Member::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void Member::InternalSwap(Member* PROTOBUF_RESTRICT other) { - using std::swap; - auto* arena = GetArena(); - ABSL_DCHECK_EQ(arena, other->GetArena()); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.peer_urls_.InternalSwap(&other->_impl_.peer_urls_); - _impl_.client_urls_.InternalSwap(&other->_impl_.client_urls_); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); - ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.leader_name_, &other->_impl_.leader_name_, arena); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(Member, _impl_.leader_id_) - + sizeof(Member::_impl_.leader_id_) - - PROTOBUF_FIELD_OFFSET(Member, _impl_.member_id_)>( - reinterpret_cast(&_impl_.member_id_), - reinterpret_cast(&other->_impl_.member_id_)); -} - -::google::protobuf::Metadata Member::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[8]); -} -// =================================================================== - -class GetMembersResponse::_Internal { - public: - using HasBits = decltype(std::declval()._impl_._has_bits_); - static constexpr ::int32_t kHasBitsOffset = - 8 * PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_._has_bits_); - static const ::pdpb::ResponseHeader& header(const GetMembersResponse* msg); - static void set_has_header(HasBits* has_bits) { - (*has_bits)[0] |= 1u; - } - static const ::pdpb::Member& leader(const GetMembersResponse* msg); - static void set_has_leader(HasBits* has_bits) { - (*has_bits)[0] |= 2u; - } - static const ::pdpb::Member& etcd_leader(const GetMembersResponse* msg); - static void set_has_etcd_leader(HasBits* has_bits) { - (*has_bits)[0] |= 4u; - } -}; - -const ::pdpb::ResponseHeader& GetMembersResponse::_Internal::header(const GetMembersResponse* msg) { - return *msg->_impl_.header_; -} -const ::pdpb::Member& GetMembersResponse::_Internal::leader(const GetMembersResponse* msg) { - return *msg->_impl_.leader_; -} -const ::pdpb::Member& GetMembersResponse::_Internal::etcd_leader(const GetMembersResponse* msg) { - return *msg->_impl_.etcd_leader_; -} -GetMembersResponse::GetMembersResponse(::google::protobuf::Arena* arena) - : ::google::protobuf::Message(arena) { - SharedCtor(arena); - // @@protoc_insertion_point(arena_constructor:pdpb.GetMembersResponse) -} -inline PROTOBUF_NDEBUG_INLINE GetMembersResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, - const Impl_& from) - : _has_bits_{from._has_bits_}, - _cached_size_{0}, - members_{visibility, arena, from.members_} {} - -GetMembersResponse::GetMembersResponse( - ::google::protobuf::Arena* arena, - const GetMembersResponse& from) - : ::google::protobuf::Message(arena) { - GetMembersResponse* const _this = this; - (void)_this; - _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( - from._internal_metadata_); - new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); - ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.header_ = (cached_has_bits & 0x00000001u) - ? CreateMaybeMessage<::pdpb::ResponseHeader>(arena, *from._impl_.header_) - : nullptr; - _impl_.leader_ = (cached_has_bits & 0x00000002u) - ? CreateMaybeMessage<::pdpb::Member>(arena, *from._impl_.leader_) - : nullptr; - _impl_.etcd_leader_ = (cached_has_bits & 0x00000004u) - ? CreateMaybeMessage<::pdpb::Member>(arena, *from._impl_.etcd_leader_) - : nullptr; - - // @@protoc_insertion_point(copy_constructor:pdpb.GetMembersResponse) -} -inline PROTOBUF_NDEBUG_INLINE GetMembersResponse::Impl_::Impl_( - ::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena) - : _cached_size_{0}, - members_{visibility, arena} {} - -inline void GetMembersResponse::SharedCtor(::_pb::Arena* arena) { - new (&_impl_) Impl_(internal_visibility(), arena); - ::memset(reinterpret_cast(&_impl_) + - offsetof(Impl_, header_), - 0, - offsetof(Impl_, etcd_leader_) - - offsetof(Impl_, header_) + - sizeof(Impl_::etcd_leader_)); -} -GetMembersResponse::~GetMembersResponse() { - // @@protoc_insertion_point(destructor:pdpb.GetMembersResponse) - _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); - SharedDtor(); -} -inline void GetMembersResponse::SharedDtor() { - ABSL_DCHECK(GetArena() == nullptr); - delete _impl_.header_; - delete _impl_.leader_; - delete _impl_.etcd_leader_; - _impl_.~Impl_(); -} - -PROTOBUF_NOINLINE void GetMembersResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:pdpb.GetMembersResponse) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _impl_.members_.Clear(); - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - ABSL_DCHECK(_impl_.header_ != nullptr); - _impl_.header_->Clear(); - } - if (cached_has_bits & 0x00000002u) { - ABSL_DCHECK(_impl_.leader_ != nullptr); - _impl_.leader_->Clear(); - } - if (cached_has_bits & 0x00000004u) { - ABSL_DCHECK(_impl_.etcd_leader_ != nullptr); - _impl_.etcd_leader_->Clear(); - } - } - _impl_._has_bits_.Clear(); - _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); -} - -const char* GetMembersResponse::_InternalParse( - const char* ptr, ::_pbi::ParseContext* ctx) { - ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header); - return ptr; -} - - -PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<2, 4, 4, 0, 2> GetMembersResponse::_table_ = { - { - PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_._has_bits_), - 0, // no _extensions_ - 4, 24, // max_field_number, fast_idx_mask - offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap - offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 4, // num_aux_entries - offsetof(decltype(_table_), aux_entries), - &_GetMembersResponse_default_instance_._instance, - ::_pbi::TcParser::GenericFallback, // fallback - }, {{ - // .pdpb.Member etcd_leader = 4; - {::_pbi::TcParser::FastMtS1, - {34, 2, 3, PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.etcd_leader_)}}, - // .pdpb.ResponseHeader header = 1; - {::_pbi::TcParser::FastMtS1, - {10, 0, 0, PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.header_)}}, - // repeated .pdpb.Member members = 2; - {::_pbi::TcParser::FastMtR1, - {18, 63, 1, PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.members_)}}, - // .pdpb.Member leader = 3; - {::_pbi::TcParser::FastMtS1, - {26, 1, 2, PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.leader_)}}, - }}, {{ - 65535, 65535 - }}, {{ - // .pdpb.ResponseHeader header = 1; - {PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.header_), _Internal::kHasBitsOffset + 0, 0, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated .pdpb.Member members = 2; - {PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.members_), -1, 1, - (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // .pdpb.Member leader = 3; - {PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.leader_), _Internal::kHasBitsOffset + 1, 2, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - // .pdpb.Member etcd_leader = 4; - {PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.etcd_leader_), _Internal::kHasBitsOffset + 2, 3, - (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, - }}, {{ - {::_pbi::TcParser::GetTable<::pdpb::ResponseHeader>()}, - {::_pbi::TcParser::GetTable<::pdpb::Member>()}, - {::_pbi::TcParser::GetTable<::pdpb::Member>()}, - {::_pbi::TcParser::GetTable<::pdpb::Member>()}, - }}, {{ - }}, -}; - -::uint8_t* GetMembersResponse::_InternalSerialize( - ::uint8_t* target, - ::google::protobuf::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:pdpb.GetMembersResponse) - ::uint32_t cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _impl_._has_bits_[0]; - // .pdpb.ResponseHeader header = 1; - if (cached_has_bits & 0x00000001u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 1, _Internal::header(this), - _Internal::header(this).GetCachedSize(), target, stream); - } - - // repeated .pdpb.Member members = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_members_size()); i < n; i++) { - const auto& repfield = this->_internal_members().Get(i); - target = ::google::protobuf::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); - } - - // .pdpb.Member leader = 3; - if (cached_has_bits & 0x00000002u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 3, _Internal::leader(this), - _Internal::leader(this).GetCachedSize(), target, stream); - } - - // .pdpb.Member etcd_leader = 4; - if (cached_has_bits & 0x00000004u) { - target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( - 4, _Internal::etcd_leader(this), - _Internal::etcd_leader(this).GetCachedSize(), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = - ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:pdpb.GetMembersResponse) - return target; -} - -::size_t GetMembersResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:pdpb.GetMembersResponse) - ::size_t total_size = 0; - - ::uint32_t cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .pdpb.Member members = 2; - total_size += 1UL * this->_internal_members_size(); - for (const auto& msg : this->_internal_members()) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSize(msg); - } - cached_has_bits = _impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - // .pdpb.ResponseHeader header = 1; - if (cached_has_bits & 0x00000001u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.header_); - } - - // .pdpb.Member leader = 3; - if (cached_has_bits & 0x00000002u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.leader_); - } - - // .pdpb.Member etcd_leader = 4; - if (cached_has_bits & 0x00000004u) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.etcd_leader_); - } - - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); -} - -const ::google::protobuf::Message::ClassData GetMembersResponse::_class_data_ = { - GetMembersResponse::MergeImpl, - nullptr, // OnDemandRegisterArenaDtor -}; -const ::google::protobuf::Message::ClassData* GetMembersResponse::GetClassData() const { - return &_class_data_; -} - -void GetMembersResponse::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:pdpb.GetMembersResponse) - ABSL_DCHECK_NE(&from, _this); - ::uint32_t cached_has_bits = 0; - (void) cached_has_bits; - - _this->_internal_mutable_members()->MergeFrom( - from._internal_members()); - cached_has_bits = from._impl_._has_bits_[0]; - if (cached_has_bits & 0x00000007u) { - if (cached_has_bits & 0x00000001u) { - _this->_internal_mutable_header()->::pdpb::ResponseHeader::MergeFrom( - from._internal_header()); - } - if (cached_has_bits & 0x00000002u) { - _this->_internal_mutable_leader()->::pdpb::Member::MergeFrom( - from._internal_leader()); - } - if (cached_has_bits & 0x00000004u) { - _this->_internal_mutable_etcd_leader()->::pdpb::Member::MergeFrom( - from._internal_etcd_leader()); - } - } - _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); -} - -void GetMembersResponse::CopyFrom(const GetMembersResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:pdpb.GetMembersResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -PROTOBUF_NOINLINE bool GetMembersResponse::IsInitialized() const { - return true; -} - -::_pbi::CachedSize* GetMembersResponse::AccessCachedSize() const { - return &_impl_._cached_size_; -} -void GetMembersResponse::InternalSwap(GetMembersResponse* PROTOBUF_RESTRICT other) { - using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); - _impl_.members_.InternalSwap(&other->_impl_.members_); - ::google::protobuf::internal::memswap< - PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.etcd_leader_) - + sizeof(GetMembersResponse::_impl_.etcd_leader_) - - PROTOBUF_FIELD_OFFSET(GetMembersResponse, _impl_.header_)>( - reinterpret_cast(&_impl_.header_), - reinterpret_cast(&other->_impl_.header_)); -} - -::google::protobuf::Metadata GetMembersResponse::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_pdpb_2eproto_getter, &descriptor_table_pdpb_2eproto_once, - file_level_metadata_pdpb_2eproto[9]); -} -// @@protoc_insertion_point(namespace_scope) -} // namespace pdpb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google -// @@protoc_insertion_point(global_scope) -#include "google/protobuf/port_undef.inc" diff --git a/ThirdParty/kvproto/generated/kvproto/pdpb.pb.h b/ThirdParty/kvproto/generated/kvproto/pdpb.pb.h deleted file mode 100644 index e16569aaa..000000000 --- a/ThirdParty/kvproto/generated/kvproto/pdpb.pb.h +++ /dev/null @@ -1,4187 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: pdpb.proto -// Protobuf C++ Version: 4.25.3 - -#ifndef GOOGLE_PROTOBUF_INCLUDED_pdpb_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_pdpb_2eproto_2epb_2eh - -#include -#include -#include -#include - -#include "google/protobuf/port_def.inc" -#if PROTOBUF_VERSION < 4025000 -#error "This file was generated by a newer version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please update" -#error "your headers." -#endif // PROTOBUF_VERSION - -#if 4025003 < PROTOBUF_MIN_PROTOC_VERSION -#error "This file was generated by an older version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please" -#error "regenerate this file with a newer version of protoc." -#endif // PROTOBUF_MIN_PROTOC_VERSION -#include "google/protobuf/port_undef.inc" -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/arena.h" -#include "google/protobuf/arenastring.h" -#include "google/protobuf/generated_message_tctable_decl.h" -#include "google/protobuf/generated_message_util.h" -#include "google/protobuf/metadata_lite.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/message.h" -#include "google/protobuf/repeated_field.h" // IWYU pragma: export -#include "google/protobuf/extension_set.h" // IWYU pragma: export -#include "google/protobuf/generated_enum_reflection.h" -#include "google/protobuf/unknown_field_set.h" -#include "metapb.pb.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" - -#define PROTOBUF_INTERNAL_EXPORT_pdpb_2eproto - -namespace google { -namespace protobuf { -namespace internal { -class AnyMetadata; -} // namespace internal -} // namespace protobuf -} // namespace google - -// Internal implementation detail -- do not use these members. -struct TableStruct_pdpb_2eproto { - static const ::uint32_t offsets[]; -}; -extern const ::google::protobuf::internal::DescriptorTable - descriptor_table_pdpb_2eproto; -namespace pdpb { -class Error; -struct ErrorDefaultTypeInternal; -extern ErrorDefaultTypeInternal _Error_default_instance_; -class GetMembersRequest; -struct GetMembersRequestDefaultTypeInternal; -extern GetMembersRequestDefaultTypeInternal _GetMembersRequest_default_instance_; -class GetMembersResponse; -struct GetMembersResponseDefaultTypeInternal; -extern GetMembersResponseDefaultTypeInternal _GetMembersResponse_default_instance_; -class GetRegionRequest; -struct GetRegionRequestDefaultTypeInternal; -extern GetRegionRequestDefaultTypeInternal _GetRegionRequest_default_instance_; -class GetRegionResponse; -struct GetRegionResponseDefaultTypeInternal; -extern GetRegionResponseDefaultTypeInternal _GetRegionResponse_default_instance_; -class GetStoreRequest; -struct GetStoreRequestDefaultTypeInternal; -extern GetStoreRequestDefaultTypeInternal _GetStoreRequest_default_instance_; -class GetStoreResponse; -struct GetStoreResponseDefaultTypeInternal; -extern GetStoreResponseDefaultTypeInternal _GetStoreResponse_default_instance_; -class Member; -struct MemberDefaultTypeInternal; -extern MemberDefaultTypeInternal _Member_default_instance_; -class RequestHeader; -struct RequestHeaderDefaultTypeInternal; -extern RequestHeaderDefaultTypeInternal _RequestHeader_default_instance_; -class ResponseHeader; -struct ResponseHeaderDefaultTypeInternal; -extern ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_; -} // namespace pdpb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google - -namespace pdpb { -enum ErrorType : int { - OK = 0, - UNKNOWN = 1, - NOT_BOOTSTRAPPED = 2, - STORE_TOMBSTONE = 3, - ALREADY_BOOTSTRAPPED = 4, - INCOMPATIBLE_VERSION = 5, - REGION_NOT_FOUND = 6, - ErrorType_INT_MIN_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::min(), - ErrorType_INT_MAX_SENTINEL_DO_NOT_USE_ = - std::numeric_limits<::int32_t>::max(), -}; - -bool ErrorType_IsValid(int value); -extern const uint32_t ErrorType_internal_data_[]; -constexpr ErrorType ErrorType_MIN = static_cast(0); -constexpr ErrorType ErrorType_MAX = static_cast(6); -constexpr int ErrorType_ARRAYSIZE = 6 + 1; -const ::google::protobuf::EnumDescriptor* -ErrorType_descriptor(); -template -const std::string& ErrorType_Name(T value) { - static_assert(std::is_same::value || - std::is_integral::value, - "Incorrect type passed to ErrorType_Name()."); - return ErrorType_Name(static_cast(value)); -} -template <> -inline const std::string& ErrorType_Name(ErrorType value) { - return ::google::protobuf::internal::NameOfDenseEnum( - static_cast(value)); -} -inline bool ErrorType_Parse(absl::string_view name, ErrorType* value) { - return ::google::protobuf::internal::ParseNamedEnum( - ErrorType_descriptor(), name, value); -} - -// =================================================================== - - -// ------------------------------------------------------------------- - -class RequestHeader final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.RequestHeader) */ { - public: - inline RequestHeader() : RequestHeader(nullptr) {} - ~RequestHeader() override; - template - explicit PROTOBUF_CONSTEXPR RequestHeader(::google::protobuf::internal::ConstantInitialized); - - inline RequestHeader(const RequestHeader& from) - : RequestHeader(nullptr, from) {} - RequestHeader(RequestHeader&& from) noexcept - : RequestHeader() { - *this = ::std::move(from); - } - - inline RequestHeader& operator=(const RequestHeader& from) { - CopyFrom(from); - return *this; - } - inline RequestHeader& operator=(RequestHeader&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const RequestHeader& default_instance() { - return *internal_default_instance(); - } - static inline const RequestHeader* internal_default_instance() { - return reinterpret_cast( - &_RequestHeader_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(RequestHeader& a, RequestHeader& b) { - a.Swap(&b); - } - inline void Swap(RequestHeader* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RequestHeader* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - RequestHeader* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const RequestHeader& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const RequestHeader& from) { - RequestHeader::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(RequestHeader* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.RequestHeader"; - } - protected: - explicit RequestHeader(::google::protobuf::Arena* arena); - RequestHeader(::google::protobuf::Arena* arena, const RequestHeader& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kClusterIdFieldNumber = 1, - kSenderIdFieldNumber = 2, - }; - // uint64 cluster_id = 1; - void clear_cluster_id() ; - ::uint64_t cluster_id() const; - void set_cluster_id(::uint64_t value); - - private: - ::uint64_t _internal_cluster_id() const; - void _internal_set_cluster_id(::uint64_t value); - - public: - // uint64 sender_id = 2; - void clear_sender_id() ; - ::uint64_t sender_id() const; - void set_sender_id(::uint64_t value); - - private: - ::uint64_t _internal_sender_id() const; - void _internal_set_sender_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:pdpb.RequestHeader) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::uint64_t cluster_id_; - ::uint64_t sender_id_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class Member final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.Member) */ { - public: - inline Member() : Member(nullptr) {} - ~Member() override; - template - explicit PROTOBUF_CONSTEXPR Member(::google::protobuf::internal::ConstantInitialized); - - inline Member(const Member& from) - : Member(nullptr, from) {} - Member(Member&& from) noexcept - : Member() { - *this = ::std::move(from); - } - - inline Member& operator=(const Member& from) { - CopyFrom(from); - return *this; - } - inline Member& operator=(Member&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Member& default_instance() { - return *internal_default_instance(); - } - static inline const Member* internal_default_instance() { - return reinterpret_cast( - &_Member_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(Member& a, Member& b) { - a.Swap(&b); - } - inline void Swap(Member* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Member* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Member* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Member& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Member& from) { - Member::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Member* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.Member"; - } - protected: - explicit Member(::google::protobuf::Arena* arena); - Member(::google::protobuf::Arena* arena, const Member& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPeerUrlsFieldNumber = 3, - kClientUrlsFieldNumber = 4, - kNameFieldNumber = 1, - kLeaderNameFieldNumber = 5, - kMemberIdFieldNumber = 2, - kLeaderIdFieldNumber = 6, - }; - // repeated string peer_urls = 3; - int peer_urls_size() const; - private: - int _internal_peer_urls_size() const; - - public: - void clear_peer_urls() ; - const std::string& peer_urls(int index) const; - std::string* mutable_peer_urls(int index); - void set_peer_urls(int index, const std::string& value); - void set_peer_urls(int index, std::string&& value); - void set_peer_urls(int index, const char* value); - void set_peer_urls(int index, const char* value, std::size_t size); - void set_peer_urls(int index, absl::string_view value); - std::string* add_peer_urls(); - void add_peer_urls(const std::string& value); - void add_peer_urls(std::string&& value); - void add_peer_urls(const char* value); - void add_peer_urls(const char* value, std::size_t size); - void add_peer_urls(absl::string_view value); - const ::google::protobuf::RepeatedPtrField& peer_urls() const; - ::google::protobuf::RepeatedPtrField* mutable_peer_urls(); - - private: - const ::google::protobuf::RepeatedPtrField& _internal_peer_urls() const; - ::google::protobuf::RepeatedPtrField* _internal_mutable_peer_urls(); - - public: - // repeated string client_urls = 4; - int client_urls_size() const; - private: - int _internal_client_urls_size() const; - - public: - void clear_client_urls() ; - const std::string& client_urls(int index) const; - std::string* mutable_client_urls(int index); - void set_client_urls(int index, const std::string& value); - void set_client_urls(int index, std::string&& value); - void set_client_urls(int index, const char* value); - void set_client_urls(int index, const char* value, std::size_t size); - void set_client_urls(int index, absl::string_view value); - std::string* add_client_urls(); - void add_client_urls(const std::string& value); - void add_client_urls(std::string&& value); - void add_client_urls(const char* value); - void add_client_urls(const char* value, std::size_t size); - void add_client_urls(absl::string_view value); - const ::google::protobuf::RepeatedPtrField& client_urls() const; - ::google::protobuf::RepeatedPtrField* mutable_client_urls(); - - private: - const ::google::protobuf::RepeatedPtrField& _internal_client_urls() const; - ::google::protobuf::RepeatedPtrField* _internal_mutable_client_urls(); - - public: - // string name = 1; - void clear_name() ; - const std::string& name() const; - template - void set_name(Arg_&& arg, Args_... args); - std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); - void set_allocated_name(std::string* value); - - private: - const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name( - const std::string& value); - std::string* _internal_mutable_name(); - - public: - // string leader_name = 5; - void clear_leader_name() ; - const std::string& leader_name() const; - template - void set_leader_name(Arg_&& arg, Args_... args); - std::string* mutable_leader_name(); - PROTOBUF_NODISCARD std::string* release_leader_name(); - void set_allocated_leader_name(std::string* value); - - private: - const std::string& _internal_leader_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_leader_name( - const std::string& value); - std::string* _internal_mutable_leader_name(); - - public: - // uint64 member_id = 2; - void clear_member_id() ; - ::uint64_t member_id() const; - void set_member_id(::uint64_t value); - - private: - ::uint64_t _internal_member_id() const; - void _internal_set_member_id(::uint64_t value); - - public: - // uint64 leader_id = 6; - void clear_leader_id() ; - ::uint64_t leader_id() const; - void set_leader_id(::uint64_t value); - - private: - ::uint64_t _internal_leader_id() const; - void _internal_set_leader_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:pdpb.Member) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 6, 0, - 55, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::RepeatedPtrField peer_urls_; - ::google::protobuf::RepeatedPtrField client_urls_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::google::protobuf::internal::ArenaStringPtr leader_name_; - ::uint64_t member_id_; - ::uint64_t leader_id_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class Error final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.Error) */ { - public: - inline Error() : Error(nullptr) {} - ~Error() override; - template - explicit PROTOBUF_CONSTEXPR Error(::google::protobuf::internal::ConstantInitialized); - - inline Error(const Error& from) - : Error(nullptr, from) {} - Error(Error&& from) noexcept - : Error() { - *this = ::std::move(from); - } - - inline Error& operator=(const Error& from) { - CopyFrom(from); - return *this; - } - inline Error& operator=(Error&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Error& default_instance() { - return *internal_default_instance(); - } - static inline const Error* internal_default_instance() { - return reinterpret_cast( - &_Error_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(Error& a, Error& b) { - a.Swap(&b); - } - inline void Swap(Error* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Error* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - Error* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const Error& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const Error& from) { - Error::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(Error* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.Error"; - } - protected: - explicit Error(::google::protobuf::Arena* arena); - Error(::google::protobuf::Arena* arena, const Error& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kMessageFieldNumber = 2, - kTypeFieldNumber = 1, - }; - // string message = 2; - void clear_message() ; - const std::string& message() const; - template - void set_message(Arg_&& arg, Args_... args); - std::string* mutable_message(); - PROTOBUF_NODISCARD std::string* release_message(); - void set_allocated_message(std::string* value); - - private: - const std::string& _internal_message() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_message( - const std::string& value); - std::string* _internal_mutable_message(); - - public: - // .pdpb.ErrorType type = 1; - void clear_type() ; - ::pdpb::ErrorType type() const; - void set_type(::pdpb::ErrorType value); - - private: - ::pdpb::ErrorType _internal_type() const; - void _internal_set_type(::pdpb::ErrorType value); - - public: - // @@protoc_insertion_point(class_scope:pdpb.Error) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 0, - 26, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::ArenaStringPtr message_; - int type_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class ResponseHeader final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.ResponseHeader) */ { - public: - inline ResponseHeader() : ResponseHeader(nullptr) {} - ~ResponseHeader() override; - template - explicit PROTOBUF_CONSTEXPR ResponseHeader(::google::protobuf::internal::ConstantInitialized); - - inline ResponseHeader(const ResponseHeader& from) - : ResponseHeader(nullptr, from) {} - ResponseHeader(ResponseHeader&& from) noexcept - : ResponseHeader() { - *this = ::std::move(from); - } - - inline ResponseHeader& operator=(const ResponseHeader& from) { - CopyFrom(from); - return *this; - } - inline ResponseHeader& operator=(ResponseHeader&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const ResponseHeader& default_instance() { - return *internal_default_instance(); - } - static inline const ResponseHeader* internal_default_instance() { - return reinterpret_cast( - &_ResponseHeader_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(ResponseHeader& a, ResponseHeader& b) { - a.Swap(&b); - } - inline void Swap(ResponseHeader* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(ResponseHeader* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - ResponseHeader* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const ResponseHeader& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const ResponseHeader& from) { - ResponseHeader::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(ResponseHeader* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.ResponseHeader"; - } - protected: - explicit ResponseHeader(::google::protobuf::Arena* arena); - ResponseHeader(::google::protobuf::Arena* arena, const ResponseHeader& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kErrorFieldNumber = 2, - kClusterIdFieldNumber = 1, - }; - // .pdpb.Error error = 2; - bool has_error() const; - void clear_error() ; - const ::pdpb::Error& error() const; - PROTOBUF_NODISCARD ::pdpb::Error* release_error(); - ::pdpb::Error* mutable_error(); - void set_allocated_error(::pdpb::Error* value); - void unsafe_arena_set_allocated_error(::pdpb::Error* value); - ::pdpb::Error* unsafe_arena_release_error(); - - private: - const ::pdpb::Error& _internal_error() const; - ::pdpb::Error* _internal_mutable_error(); - - public: - // uint64 cluster_id = 1; - void clear_cluster_id() ; - ::uint64_t cluster_id() const; - void set_cluster_id(::uint64_t value); - - private: - ::uint64_t _internal_cluster_id() const; - void _internal_set_cluster_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:pdpb.ResponseHeader) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::pdpb::Error* error_; - ::uint64_t cluster_id_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class GetStoreRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.GetStoreRequest) */ { - public: - inline GetStoreRequest() : GetStoreRequest(nullptr) {} - ~GetStoreRequest() override; - template - explicit PROTOBUF_CONSTEXPR GetStoreRequest(::google::protobuf::internal::ConstantInitialized); - - inline GetStoreRequest(const GetStoreRequest& from) - : GetStoreRequest(nullptr, from) {} - GetStoreRequest(GetStoreRequest&& from) noexcept - : GetStoreRequest() { - *this = ::std::move(from); - } - - inline GetStoreRequest& operator=(const GetStoreRequest& from) { - CopyFrom(from); - return *this; - } - inline GetStoreRequest& operator=(GetStoreRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GetStoreRequest& default_instance() { - return *internal_default_instance(); - } - static inline const GetStoreRequest* internal_default_instance() { - return reinterpret_cast( - &_GetStoreRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(GetStoreRequest& a, GetStoreRequest& b) { - a.Swap(&b); - } - inline void Swap(GetStoreRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GetStoreRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - GetStoreRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const GetStoreRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const GetStoreRequest& from) { - GetStoreRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(GetStoreRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.GetStoreRequest"; - } - protected: - explicit GetStoreRequest(::google::protobuf::Arena* arena); - GetStoreRequest(::google::protobuf::Arena* arena, const GetStoreRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kHeaderFieldNumber = 1, - kStoreIdFieldNumber = 2, - }; - // .pdpb.RequestHeader header = 1; - bool has_header() const; - void clear_header() ; - const ::pdpb::RequestHeader& header() const; - PROTOBUF_NODISCARD ::pdpb::RequestHeader* release_header(); - ::pdpb::RequestHeader* mutable_header(); - void set_allocated_header(::pdpb::RequestHeader* value); - void unsafe_arena_set_allocated_header(::pdpb::RequestHeader* value); - ::pdpb::RequestHeader* unsafe_arena_release_header(); - - private: - const ::pdpb::RequestHeader& _internal_header() const; - ::pdpb::RequestHeader* _internal_mutable_header(); - - public: - // uint64 store_id = 2; - void clear_store_id() ; - ::uint64_t store_id() const; - void set_store_id(::uint64_t value); - - private: - ::uint64_t _internal_store_id() const; - void _internal_set_store_id(::uint64_t value); - - public: - // @@protoc_insertion_point(class_scope:pdpb.GetStoreRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::pdpb::RequestHeader* header_; - ::uint64_t store_id_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class GetRegionRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.GetRegionRequest) */ { - public: - inline GetRegionRequest() : GetRegionRequest(nullptr) {} - ~GetRegionRequest() override; - template - explicit PROTOBUF_CONSTEXPR GetRegionRequest(::google::protobuf::internal::ConstantInitialized); - - inline GetRegionRequest(const GetRegionRequest& from) - : GetRegionRequest(nullptr, from) {} - GetRegionRequest(GetRegionRequest&& from) noexcept - : GetRegionRequest() { - *this = ::std::move(from); - } - - inline GetRegionRequest& operator=(const GetRegionRequest& from) { - CopyFrom(from); - return *this; - } - inline GetRegionRequest& operator=(GetRegionRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GetRegionRequest& default_instance() { - return *internal_default_instance(); - } - static inline const GetRegionRequest* internal_default_instance() { - return reinterpret_cast( - &_GetRegionRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(GetRegionRequest& a, GetRegionRequest& b) { - a.Swap(&b); - } - inline void Swap(GetRegionRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GetRegionRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - GetRegionRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const GetRegionRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const GetRegionRequest& from) { - GetRegionRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(GetRegionRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.GetRegionRequest"; - } - protected: - explicit GetRegionRequest(::google::protobuf::Arena* arena); - GetRegionRequest(::google::protobuf::Arena* arena, const GetRegionRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRegionKeyFieldNumber = 2, - kHeaderFieldNumber = 1, - }; - // bytes region_key = 2; - void clear_region_key() ; - const std::string& region_key() const; - template - void set_region_key(Arg_&& arg, Args_... args); - std::string* mutable_region_key(); - PROTOBUF_NODISCARD std::string* release_region_key(); - void set_allocated_region_key(std::string* value); - - private: - const std::string& _internal_region_key() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_region_key( - const std::string& value); - std::string* _internal_mutable_region_key(); - - public: - // .pdpb.RequestHeader header = 1; - bool has_header() const; - void clear_header() ; - const ::pdpb::RequestHeader& header() const; - PROTOBUF_NODISCARD ::pdpb::RequestHeader* release_header(); - ::pdpb::RequestHeader* mutable_header(); - void set_allocated_header(::pdpb::RequestHeader* value); - void unsafe_arena_set_allocated_header(::pdpb::RequestHeader* value); - ::pdpb::RequestHeader* unsafe_arena_release_header(); - - private: - const ::pdpb::RequestHeader& _internal_header() const; - ::pdpb::RequestHeader* _internal_mutable_header(); - - public: - // @@protoc_insertion_point(class_scope:pdpb.GetRegionRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr region_key_; - ::pdpb::RequestHeader* header_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class GetMembersRequest final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.GetMembersRequest) */ { - public: - inline GetMembersRequest() : GetMembersRequest(nullptr) {} - ~GetMembersRequest() override; - template - explicit PROTOBUF_CONSTEXPR GetMembersRequest(::google::protobuf::internal::ConstantInitialized); - - inline GetMembersRequest(const GetMembersRequest& from) - : GetMembersRequest(nullptr, from) {} - GetMembersRequest(GetMembersRequest&& from) noexcept - : GetMembersRequest() { - *this = ::std::move(from); - } - - inline GetMembersRequest& operator=(const GetMembersRequest& from) { - CopyFrom(from); - return *this; - } - inline GetMembersRequest& operator=(GetMembersRequest&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GetMembersRequest& default_instance() { - return *internal_default_instance(); - } - static inline const GetMembersRequest* internal_default_instance() { - return reinterpret_cast( - &_GetMembersRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(GetMembersRequest& a, GetMembersRequest& b) { - a.Swap(&b); - } - inline void Swap(GetMembersRequest* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GetMembersRequest* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - GetMembersRequest* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const GetMembersRequest& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const GetMembersRequest& from) { - GetMembersRequest::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(GetMembersRequest* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.GetMembersRequest"; - } - protected: - explicit GetMembersRequest(::google::protobuf::Arena* arena); - GetMembersRequest(::google::protobuf::Arena* arena, const GetMembersRequest& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kHeaderFieldNumber = 1, - }; - // .pdpb.RequestHeader header = 1; - bool has_header() const; - void clear_header() ; - const ::pdpb::RequestHeader& header() const; - PROTOBUF_NODISCARD ::pdpb::RequestHeader* release_header(); - ::pdpb::RequestHeader* mutable_header(); - void set_allocated_header(::pdpb::RequestHeader* value); - void unsafe_arena_set_allocated_header(::pdpb::RequestHeader* value); - ::pdpb::RequestHeader* unsafe_arena_release_header(); - - private: - const ::pdpb::RequestHeader& _internal_header() const; - ::pdpb::RequestHeader* _internal_mutable_header(); - - public: - // @@protoc_insertion_point(class_scope:pdpb.GetMembersRequest) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 0, 1, 1, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::pdpb::RequestHeader* header_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class GetStoreResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.GetStoreResponse) */ { - public: - inline GetStoreResponse() : GetStoreResponse(nullptr) {} - ~GetStoreResponse() override; - template - explicit PROTOBUF_CONSTEXPR GetStoreResponse(::google::protobuf::internal::ConstantInitialized); - - inline GetStoreResponse(const GetStoreResponse& from) - : GetStoreResponse(nullptr, from) {} - GetStoreResponse(GetStoreResponse&& from) noexcept - : GetStoreResponse() { - *this = ::std::move(from); - } - - inline GetStoreResponse& operator=(const GetStoreResponse& from) { - CopyFrom(from); - return *this; - } - inline GetStoreResponse& operator=(GetStoreResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GetStoreResponse& default_instance() { - return *internal_default_instance(); - } - static inline const GetStoreResponse* internal_default_instance() { - return reinterpret_cast( - &_GetStoreResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(GetStoreResponse& a, GetStoreResponse& b) { - a.Swap(&b); - } - inline void Swap(GetStoreResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GetStoreResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - GetStoreResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const GetStoreResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const GetStoreResponse& from) { - GetStoreResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(GetStoreResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.GetStoreResponse"; - } - protected: - explicit GetStoreResponse(::google::protobuf::Arena* arena); - GetStoreResponse(::google::protobuf::Arena* arena, const GetStoreResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kHeaderFieldNumber = 1, - kStoreFieldNumber = 2, - }; - // .pdpb.ResponseHeader header = 1; - bool has_header() const; - void clear_header() ; - const ::pdpb::ResponseHeader& header() const; - PROTOBUF_NODISCARD ::pdpb::ResponseHeader* release_header(); - ::pdpb::ResponseHeader* mutable_header(); - void set_allocated_header(::pdpb::ResponseHeader* value); - void unsafe_arena_set_allocated_header(::pdpb::ResponseHeader* value); - ::pdpb::ResponseHeader* unsafe_arena_release_header(); - - private: - const ::pdpb::ResponseHeader& _internal_header() const; - ::pdpb::ResponseHeader* _internal_mutable_header(); - - public: - // .metapb.Store store = 2; - bool has_store() const; - void clear_store() ; - const ::metapb::Store& store() const; - PROTOBUF_NODISCARD ::metapb::Store* release_store(); - ::metapb::Store* mutable_store(); - void set_allocated_store(::metapb::Store* value); - void unsafe_arena_set_allocated_store(::metapb::Store* value); - ::metapb::Store* unsafe_arena_release_store(); - - private: - const ::metapb::Store& _internal_store() const; - ::metapb::Store* _internal_mutable_store(); - - public: - // @@protoc_insertion_point(class_scope:pdpb.GetStoreResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 1, 2, 2, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::pdpb::ResponseHeader* header_; - ::metapb::Store* store_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class GetRegionResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.GetRegionResponse) */ { - public: - inline GetRegionResponse() : GetRegionResponse(nullptr) {} - ~GetRegionResponse() override; - template - explicit PROTOBUF_CONSTEXPR GetRegionResponse(::google::protobuf::internal::ConstantInitialized); - - inline GetRegionResponse(const GetRegionResponse& from) - : GetRegionResponse(nullptr, from) {} - GetRegionResponse(GetRegionResponse&& from) noexcept - : GetRegionResponse() { - *this = ::std::move(from); - } - - inline GetRegionResponse& operator=(const GetRegionResponse& from) { - CopyFrom(from); - return *this; - } - inline GetRegionResponse& operator=(GetRegionResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GetRegionResponse& default_instance() { - return *internal_default_instance(); - } - static inline const GetRegionResponse* internal_default_instance() { - return reinterpret_cast( - &_GetRegionResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(GetRegionResponse& a, GetRegionResponse& b) { - a.Swap(&b); - } - inline void Swap(GetRegionResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GetRegionResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - GetRegionResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const GetRegionResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const GetRegionResponse& from) { - GetRegionResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(GetRegionResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.GetRegionResponse"; - } - protected: - explicit GetRegionResponse(::google::protobuf::Arena* arena); - GetRegionResponse(::google::protobuf::Arena* arena, const GetRegionResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kDownPeersFieldNumber = 4, - kPendingPeersFieldNumber = 5, - kHeaderFieldNumber = 1, - kRegionFieldNumber = 2, - kLeaderFieldNumber = 3, - }; - // repeated .metapb.Peer down_peers = 4; - int down_peers_size() const; - private: - int _internal_down_peers_size() const; - - public: - void clear_down_peers() ; - ::metapb::Peer* mutable_down_peers(int index); - ::google::protobuf::RepeatedPtrField< ::metapb::Peer >* - mutable_down_peers(); - private: - const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& _internal_down_peers() const; - ::google::protobuf::RepeatedPtrField<::metapb::Peer>* _internal_mutable_down_peers(); - public: - const ::metapb::Peer& down_peers(int index) const; - ::metapb::Peer* add_down_peers(); - const ::google::protobuf::RepeatedPtrField< ::metapb::Peer >& - down_peers() const; - // repeated .metapb.Peer pending_peers = 5; - int pending_peers_size() const; - private: - int _internal_pending_peers_size() const; - - public: - void clear_pending_peers() ; - ::metapb::Peer* mutable_pending_peers(int index); - ::google::protobuf::RepeatedPtrField< ::metapb::Peer >* - mutable_pending_peers(); - private: - const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& _internal_pending_peers() const; - ::google::protobuf::RepeatedPtrField<::metapb::Peer>* _internal_mutable_pending_peers(); - public: - const ::metapb::Peer& pending_peers(int index) const; - ::metapb::Peer* add_pending_peers(); - const ::google::protobuf::RepeatedPtrField< ::metapb::Peer >& - pending_peers() const; - // .pdpb.ResponseHeader header = 1; - bool has_header() const; - void clear_header() ; - const ::pdpb::ResponseHeader& header() const; - PROTOBUF_NODISCARD ::pdpb::ResponseHeader* release_header(); - ::pdpb::ResponseHeader* mutable_header(); - void set_allocated_header(::pdpb::ResponseHeader* value); - void unsafe_arena_set_allocated_header(::pdpb::ResponseHeader* value); - ::pdpb::ResponseHeader* unsafe_arena_release_header(); - - private: - const ::pdpb::ResponseHeader& _internal_header() const; - ::pdpb::ResponseHeader* _internal_mutable_header(); - - public: - // .metapb.Region region = 2; - bool has_region() const; - void clear_region() ; - const ::metapb::Region& region() const; - PROTOBUF_NODISCARD ::metapb::Region* release_region(); - ::metapb::Region* mutable_region(); - void set_allocated_region(::metapb::Region* value); - void unsafe_arena_set_allocated_region(::metapb::Region* value); - ::metapb::Region* unsafe_arena_release_region(); - - private: - const ::metapb::Region& _internal_region() const; - ::metapb::Region* _internal_mutable_region(); - - public: - // .metapb.Peer leader = 3; - bool has_leader() const; - void clear_leader() ; - const ::metapb::Peer& leader() const; - PROTOBUF_NODISCARD ::metapb::Peer* release_leader(); - ::metapb::Peer* mutable_leader(); - void set_allocated_leader(::metapb::Peer* value); - void unsafe_arena_set_allocated_leader(::metapb::Peer* value); - ::metapb::Peer* unsafe_arena_release_leader(); - - private: - const ::metapb::Peer& _internal_leader() const; - ::metapb::Peer* _internal_mutable_leader(); - - public: - // @@protoc_insertion_point(class_scope:pdpb.GetRegionResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 3, 5, 5, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField< ::metapb::Peer > down_peers_; - ::google::protobuf::RepeatedPtrField< ::metapb::Peer > pending_peers_; - ::pdpb::ResponseHeader* header_; - ::metapb::Region* region_; - ::metapb::Peer* leader_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -};// ------------------------------------------------------------------- - -class GetMembersResponse final : - public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pdpb.GetMembersResponse) */ { - public: - inline GetMembersResponse() : GetMembersResponse(nullptr) {} - ~GetMembersResponse() override; - template - explicit PROTOBUF_CONSTEXPR GetMembersResponse(::google::protobuf::internal::ConstantInitialized); - - inline GetMembersResponse(const GetMembersResponse& from) - : GetMembersResponse(nullptr, from) {} - GetMembersResponse(GetMembersResponse&& from) noexcept - : GetMembersResponse() { - *this = ::std::move(from); - } - - inline GetMembersResponse& operator=(const GetMembersResponse& from) { - CopyFrom(from); - return *this; - } - inline GetMembersResponse& operator=(GetMembersResponse&& from) noexcept { - if (this == &from) return *this; - if (GetArena() == from.GetArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); - } - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); - } - - static const ::google::protobuf::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::google::protobuf::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; - } - static const ::google::protobuf::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GetMembersResponse& default_instance() { - return *internal_default_instance(); - } - static inline const GetMembersResponse* internal_default_instance() { - return reinterpret_cast( - &_GetMembersResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(GetMembersResponse& a, GetMembersResponse& b) { - a.Swap(&b); - } - inline void Swap(GetMembersResponse* other) { - if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() != nullptr && - GetArena() == other->GetArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetArena() == other->GetArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP - InternalSwap(other); - } else { - ::google::protobuf::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GetMembersResponse* other) { - if (other == this) return; - ABSL_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - GetMembersResponse* New(::google::protobuf::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::google::protobuf::Message::CopyFrom; - void CopyFrom(const GetMembersResponse& from); - using ::google::protobuf::Message::MergeFrom; - void MergeFrom( const GetMembersResponse& from) { - GetMembersResponse::MergeImpl(*this, from); - } - private: - static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg); - public: - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - ::size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final; - ::uint8_t* _InternalSerialize( - ::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const { return _impl_._cached_size_.Get(); } - - private: - ::google::protobuf::internal::CachedSize* AccessCachedSize() const final; - void SharedCtor(::google::protobuf::Arena* arena); - void SharedDtor(); - void InternalSwap(GetMembersResponse* other); - - private: - friend class ::google::protobuf::internal::AnyMetadata; - static ::absl::string_view FullMessageName() { - return "pdpb.GetMembersResponse"; - } - protected: - explicit GetMembersResponse(::google::protobuf::Arena* arena); - GetMembersResponse(::google::protobuf::Arena* arena, const GetMembersResponse& from); - public: - - static const ClassData _class_data_; - const ::google::protobuf::Message::ClassData*GetClassData() const final; - - ::google::protobuf::Metadata GetMetadata() const final; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kMembersFieldNumber = 2, - kHeaderFieldNumber = 1, - kLeaderFieldNumber = 3, - kEtcdLeaderFieldNumber = 4, - }; - // repeated .pdpb.Member members = 2; - int members_size() const; - private: - int _internal_members_size() const; - - public: - void clear_members() ; - ::pdpb::Member* mutable_members(int index); - ::google::protobuf::RepeatedPtrField< ::pdpb::Member >* - mutable_members(); - private: - const ::google::protobuf::RepeatedPtrField<::pdpb::Member>& _internal_members() const; - ::google::protobuf::RepeatedPtrField<::pdpb::Member>* _internal_mutable_members(); - public: - const ::pdpb::Member& members(int index) const; - ::pdpb::Member* add_members(); - const ::google::protobuf::RepeatedPtrField< ::pdpb::Member >& - members() const; - // .pdpb.ResponseHeader header = 1; - bool has_header() const; - void clear_header() ; - const ::pdpb::ResponseHeader& header() const; - PROTOBUF_NODISCARD ::pdpb::ResponseHeader* release_header(); - ::pdpb::ResponseHeader* mutable_header(); - void set_allocated_header(::pdpb::ResponseHeader* value); - void unsafe_arena_set_allocated_header(::pdpb::ResponseHeader* value); - ::pdpb::ResponseHeader* unsafe_arena_release_header(); - - private: - const ::pdpb::ResponseHeader& _internal_header() const; - ::pdpb::ResponseHeader* _internal_mutable_header(); - - public: - // .pdpb.Member leader = 3; - bool has_leader() const; - void clear_leader() ; - const ::pdpb::Member& leader() const; - PROTOBUF_NODISCARD ::pdpb::Member* release_leader(); - ::pdpb::Member* mutable_leader(); - void set_allocated_leader(::pdpb::Member* value); - void unsafe_arena_set_allocated_leader(::pdpb::Member* value); - ::pdpb::Member* unsafe_arena_release_leader(); - - private: - const ::pdpb::Member& _internal_leader() const; - ::pdpb::Member* _internal_mutable_leader(); - - public: - // .pdpb.Member etcd_leader = 4; - bool has_etcd_leader() const; - void clear_etcd_leader() ; - const ::pdpb::Member& etcd_leader() const; - PROTOBUF_NODISCARD ::pdpb::Member* release_etcd_leader(); - ::pdpb::Member* mutable_etcd_leader(); - void set_allocated_etcd_leader(::pdpb::Member* value); - void unsafe_arena_set_allocated_etcd_leader(::pdpb::Member* value); - ::pdpb::Member* unsafe_arena_release_etcd_leader(); - - private: - const ::pdpb::Member& _internal_etcd_leader() const; - ::pdpb::Member* _internal_mutable_etcd_leader(); - - public: - // @@protoc_insertion_point(class_scope:pdpb.GetMembersResponse) - private: - class _Internal; - - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable< - 2, 4, 4, - 0, 2> - _table_; - friend class ::google::protobuf::MessageLite; - friend class ::google::protobuf::Arena; - template - friend class ::google::protobuf::Arena::InternalHelper; - using InternalArenaConstructable_ = void; - using DestructorSkippable_ = void; - struct Impl_ { - - inline explicit constexpr Impl_( - ::google::protobuf::internal::ConstantInitialized) noexcept; - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena); - inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, - ::google::protobuf::Arena* arena, const Impl_& from); - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::RepeatedPtrField< ::pdpb::Member > members_; - ::pdpb::ResponseHeader* header_; - ::pdpb::Member* leader_; - ::pdpb::Member* etcd_leader_; - PROTOBUF_TSAN_DECLARE_MEMBER - }; - union { Impl_ _impl_; }; - friend struct ::TableStruct_pdpb_2eproto; -}; - -// =================================================================== - - - - -// =================================================================== - - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// RequestHeader - -// uint64 cluster_id = 1; -inline void RequestHeader::clear_cluster_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cluster_id_ = ::uint64_t{0u}; -} -inline ::uint64_t RequestHeader::cluster_id() const { - // @@protoc_insertion_point(field_get:pdpb.RequestHeader.cluster_id) - return _internal_cluster_id(); -} -inline void RequestHeader::set_cluster_id(::uint64_t value) { - _internal_set_cluster_id(value); - // @@protoc_insertion_point(field_set:pdpb.RequestHeader.cluster_id) -} -inline ::uint64_t RequestHeader::_internal_cluster_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cluster_id_; -} -inline void RequestHeader::_internal_set_cluster_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cluster_id_ = value; -} - -// uint64 sender_id = 2; -inline void RequestHeader::clear_sender_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.sender_id_ = ::uint64_t{0u}; -} -inline ::uint64_t RequestHeader::sender_id() const { - // @@protoc_insertion_point(field_get:pdpb.RequestHeader.sender_id) - return _internal_sender_id(); -} -inline void RequestHeader::set_sender_id(::uint64_t value) { - _internal_set_sender_id(value); - // @@protoc_insertion_point(field_set:pdpb.RequestHeader.sender_id) -} -inline ::uint64_t RequestHeader::_internal_sender_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.sender_id_; -} -inline void RequestHeader::_internal_set_sender_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.sender_id_ = value; -} - -// ------------------------------------------------------------------- - -// ResponseHeader - -// uint64 cluster_id = 1; -inline void ResponseHeader::clear_cluster_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.cluster_id_ = ::uint64_t{0u}; -} -inline ::uint64_t ResponseHeader::cluster_id() const { - // @@protoc_insertion_point(field_get:pdpb.ResponseHeader.cluster_id) - return _internal_cluster_id(); -} -inline void ResponseHeader::set_cluster_id(::uint64_t value) { - _internal_set_cluster_id(value); - // @@protoc_insertion_point(field_set:pdpb.ResponseHeader.cluster_id) -} -inline ::uint64_t ResponseHeader::_internal_cluster_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.cluster_id_; -} -inline void ResponseHeader::_internal_set_cluster_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.cluster_id_ = value; -} - -// .pdpb.Error error = 2; -inline bool ResponseHeader::has_error() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.error_ != nullptr); - return value; -} -inline void ResponseHeader::clear_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.error_ != nullptr) _impl_.error_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::pdpb::Error& ResponseHeader::_internal_error() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::Error* p = _impl_.error_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_Error_default_instance_); -} -inline const ::pdpb::Error& ResponseHeader::error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.ResponseHeader.error) - return _internal_error(); -} -inline void ResponseHeader::unsafe_arena_set_allocated_error(::pdpb::Error* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.error_); - } - _impl_.error_ = reinterpret_cast<::pdpb::Error*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.ResponseHeader.error) -} -inline ::pdpb::Error* ResponseHeader::release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::Error* released = _impl_.error_; - _impl_.error_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::Error* ResponseHeader::unsafe_arena_release_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.ResponseHeader.error) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::Error* temp = _impl_.error_; - _impl_.error_ = nullptr; - return temp; -} -inline ::pdpb::Error* ResponseHeader::_internal_mutable_error() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.error_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::Error>(GetArena()); - _impl_.error_ = reinterpret_cast<::pdpb::Error*>(p); - } - return _impl_.error_; -} -inline ::pdpb::Error* ResponseHeader::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::Error* _msg = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:pdpb.ResponseHeader.error) - return _msg; -} -inline void ResponseHeader::set_allocated_error(::pdpb::Error* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::Error*>(_impl_.error_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::Error*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.error_ = reinterpret_cast<::pdpb::Error*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.ResponseHeader.error) -} - -// ------------------------------------------------------------------- - -// Error - -// .pdpb.ErrorType type = 1; -inline void Error::clear_type() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.type_ = 0; -} -inline ::pdpb::ErrorType Error::type() const { - // @@protoc_insertion_point(field_get:pdpb.Error.type) - return _internal_type(); -} -inline void Error::set_type(::pdpb::ErrorType value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:pdpb.Error.type) -} -inline ::pdpb::ErrorType Error::_internal_type() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return static_cast<::pdpb::ErrorType>(_impl_.type_); -} -inline void Error::_internal_set_type(::pdpb::ErrorType value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.type_ = value; -} - -// string message = 2; -inline void Error::clear_message() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.message_.ClearToEmpty(); -} -inline const std::string& Error::message() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.Error.message) - return _internal_message(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Error::set_message(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.message_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:pdpb.Error.message) -} -inline std::string* Error::mutable_message() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_message(); - // @@protoc_insertion_point(field_mutable:pdpb.Error.message) - return _s; -} -inline const std::string& Error::_internal_message() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.message_.Get(); -} -inline void Error::_internal_set_message(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.message_.Set(value, GetArena()); -} -inline std::string* Error::_internal_mutable_message() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.message_.Mutable( GetArena()); -} -inline std::string* Error::release_message() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.Error.message) - return _impl_.message_.Release(); -} -inline void Error::set_allocated_message(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.message_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.message_.IsDefault()) { - _impl_.message_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:pdpb.Error.message) -} - -// ------------------------------------------------------------------- - -// GetRegionRequest - -// .pdpb.RequestHeader header = 1; -inline bool GetRegionRequest::has_header() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.header_ != nullptr); - return value; -} -inline void GetRegionRequest::clear_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.header_ != nullptr) _impl_.header_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::pdpb::RequestHeader& GetRegionRequest::_internal_header() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::RequestHeader* p = _impl_.header_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_RequestHeader_default_instance_); -} -inline const ::pdpb::RequestHeader& GetRegionRequest::header() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetRegionRequest.header) - return _internal_header(); -} -inline void GetRegionRequest::unsafe_arena_set_allocated_header(::pdpb::RequestHeader* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.header_); - } - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetRegionRequest.header) -} -inline ::pdpb::RequestHeader* GetRegionRequest::release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::RequestHeader* released = _impl_.header_; - _impl_.header_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::RequestHeader* GetRegionRequest::unsafe_arena_release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetRegionRequest.header) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::RequestHeader* temp = _impl_.header_; - _impl_.header_ = nullptr; - return temp; -} -inline ::pdpb::RequestHeader* GetRegionRequest::_internal_mutable_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.header_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::RequestHeader>(GetArena()); - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(p); - } - return _impl_.header_; -} -inline ::pdpb::RequestHeader* GetRegionRequest::mutable_header() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::RequestHeader* _msg = _internal_mutable_header(); - // @@protoc_insertion_point(field_mutable:pdpb.GetRegionRequest.header) - return _msg; -} -inline void GetRegionRequest::set_allocated_header(::pdpb::RequestHeader* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::RequestHeader*>(_impl_.header_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::RequestHeader*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetRegionRequest.header) -} - -// bytes region_key = 2; -inline void GetRegionRequest::clear_region_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.region_key_.ClearToEmpty(); -} -inline const std::string& GetRegionRequest::region_key() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetRegionRequest.region_key) - return _internal_region_key(); -} -template -inline PROTOBUF_ALWAYS_INLINE void GetRegionRequest::set_region_key(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.region_key_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:pdpb.GetRegionRequest.region_key) -} -inline std::string* GetRegionRequest::mutable_region_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_region_key(); - // @@protoc_insertion_point(field_mutable:pdpb.GetRegionRequest.region_key) - return _s; -} -inline const std::string& GetRegionRequest::_internal_region_key() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.region_key_.Get(); -} -inline void GetRegionRequest::_internal_set_region_key(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.region_key_.Set(value, GetArena()); -} -inline std::string* GetRegionRequest::_internal_mutable_region_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.region_key_.Mutable( GetArena()); -} -inline std::string* GetRegionRequest::release_region_key() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetRegionRequest.region_key) - return _impl_.region_key_.Release(); -} -inline void GetRegionRequest::set_allocated_region_key(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.region_key_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.region_key_.IsDefault()) { - _impl_.region_key_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:pdpb.GetRegionRequest.region_key) -} - -// ------------------------------------------------------------------- - -// GetRegionResponse - -// .pdpb.ResponseHeader header = 1; -inline bool GetRegionResponse::has_header() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.header_ != nullptr); - return value; -} -inline void GetRegionResponse::clear_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.header_ != nullptr) _impl_.header_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::pdpb::ResponseHeader& GetRegionResponse::_internal_header() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::ResponseHeader* p = _impl_.header_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_ResponseHeader_default_instance_); -} -inline const ::pdpb::ResponseHeader& GetRegionResponse::header() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetRegionResponse.header) - return _internal_header(); -} -inline void GetRegionResponse::unsafe_arena_set_allocated_header(::pdpb::ResponseHeader* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.header_); - } - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetRegionResponse.header) -} -inline ::pdpb::ResponseHeader* GetRegionResponse::release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::ResponseHeader* released = _impl_.header_; - _impl_.header_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::ResponseHeader* GetRegionResponse::unsafe_arena_release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetRegionResponse.header) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::ResponseHeader* temp = _impl_.header_; - _impl_.header_ = nullptr; - return temp; -} -inline ::pdpb::ResponseHeader* GetRegionResponse::_internal_mutable_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.header_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::ResponseHeader>(GetArena()); - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(p); - } - return _impl_.header_; -} -inline ::pdpb::ResponseHeader* GetRegionResponse::mutable_header() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::ResponseHeader* _msg = _internal_mutable_header(); - // @@protoc_insertion_point(field_mutable:pdpb.GetRegionResponse.header) - return _msg; -} -inline void GetRegionResponse::set_allocated_header(::pdpb::ResponseHeader* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::ResponseHeader*>(_impl_.header_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::ResponseHeader*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetRegionResponse.header) -} - -// .metapb.Region region = 2; -inline bool GetRegionResponse::has_region() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.region_ != nullptr); - return value; -} -inline const ::metapb::Region& GetRegionResponse::_internal_region() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::metapb::Region* p = _impl_.region_; - return p != nullptr ? *p : reinterpret_cast(::metapb::_Region_default_instance_); -} -inline const ::metapb::Region& GetRegionResponse::region() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetRegionResponse.region) - return _internal_region(); -} -inline void GetRegionResponse::unsafe_arena_set_allocated_region(::metapb::Region* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_); - } - _impl_.region_ = reinterpret_cast<::metapb::Region*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetRegionResponse.region) -} -inline ::metapb::Region* GetRegionResponse::release_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000002u; - ::metapb::Region* released = _impl_.region_; - _impl_.region_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::metapb::Region* GetRegionResponse::unsafe_arena_release_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetRegionResponse.region) - - _impl_._has_bits_[0] &= ~0x00000002u; - ::metapb::Region* temp = _impl_.region_; - _impl_.region_ = nullptr; - return temp; -} -inline ::metapb::Region* GetRegionResponse::_internal_mutable_region() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.region_ == nullptr) { - auto* p = CreateMaybeMessage<::metapb::Region>(GetArena()); - _impl_.region_ = reinterpret_cast<::metapb::Region*>(p); - } - return _impl_.region_; -} -inline ::metapb::Region* GetRegionResponse::mutable_region() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::metapb::Region* _msg = _internal_mutable_region(); - // @@protoc_insertion_point(field_mutable:pdpb.GetRegionResponse.region) - return _msg; -} -inline void GetRegionResponse::set_allocated_region(::metapb::Region* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.region_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - - _impl_.region_ = reinterpret_cast<::metapb::Region*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetRegionResponse.region) -} - -// .metapb.Peer leader = 3; -inline bool GetRegionResponse::has_leader() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.leader_ != nullptr); - return value; -} -inline const ::metapb::Peer& GetRegionResponse::_internal_leader() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::metapb::Peer* p = _impl_.leader_; - return p != nullptr ? *p : reinterpret_cast(::metapb::_Peer_default_instance_); -} -inline const ::metapb::Peer& GetRegionResponse::leader() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetRegionResponse.leader) - return _internal_leader(); -} -inline void GetRegionResponse::unsafe_arena_set_allocated_leader(::metapb::Peer* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.leader_); - } - _impl_.leader_ = reinterpret_cast<::metapb::Peer*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetRegionResponse.leader) -} -inline ::metapb::Peer* GetRegionResponse::release_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000004u; - ::metapb::Peer* released = _impl_.leader_; - _impl_.leader_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::metapb::Peer* GetRegionResponse::unsafe_arena_release_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetRegionResponse.leader) - - _impl_._has_bits_[0] &= ~0x00000004u; - ::metapb::Peer* temp = _impl_.leader_; - _impl_.leader_ = nullptr; - return temp; -} -inline ::metapb::Peer* GetRegionResponse::_internal_mutable_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.leader_ == nullptr) { - auto* p = CreateMaybeMessage<::metapb::Peer>(GetArena()); - _impl_.leader_ = reinterpret_cast<::metapb::Peer*>(p); - } - return _impl_.leader_; -} -inline ::metapb::Peer* GetRegionResponse::mutable_leader() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::metapb::Peer* _msg = _internal_mutable_leader(); - // @@protoc_insertion_point(field_mutable:pdpb.GetRegionResponse.leader) - return _msg; -} -inline void GetRegionResponse::set_allocated_leader(::metapb::Peer* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.leader_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - - _impl_.leader_ = reinterpret_cast<::metapb::Peer*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetRegionResponse.leader) -} - -// repeated .metapb.Peer down_peers = 4; -inline int GetRegionResponse::_internal_down_peers_size() const { - return _internal_down_peers().size(); -} -inline int GetRegionResponse::down_peers_size() const { - return _internal_down_peers_size(); -} -inline ::metapb::Peer* GetRegionResponse::mutable_down_peers(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:pdpb.GetRegionResponse.down_peers) - return _internal_mutable_down_peers()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Peer>* GetRegionResponse::mutable_down_peers() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:pdpb.GetRegionResponse.down_peers) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_down_peers(); -} -inline const ::metapb::Peer& GetRegionResponse::down_peers(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetRegionResponse.down_peers) - return _internal_down_peers().Get(index); -} -inline ::metapb::Peer* GetRegionResponse::add_down_peers() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::metapb::Peer* _add = _internal_mutable_down_peers()->Add(); - // @@protoc_insertion_point(field_add:pdpb.GetRegionResponse.down_peers) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& GetRegionResponse::down_peers() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:pdpb.GetRegionResponse.down_peers) - return _internal_down_peers(); -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& -GetRegionResponse::_internal_down_peers() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.down_peers_; -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Peer>* -GetRegionResponse::_internal_mutable_down_peers() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.down_peers_; -} - -// repeated .metapb.Peer pending_peers = 5; -inline int GetRegionResponse::_internal_pending_peers_size() const { - return _internal_pending_peers().size(); -} -inline int GetRegionResponse::pending_peers_size() const { - return _internal_pending_peers_size(); -} -inline ::metapb::Peer* GetRegionResponse::mutable_pending_peers(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:pdpb.GetRegionResponse.pending_peers) - return _internal_mutable_pending_peers()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Peer>* GetRegionResponse::mutable_pending_peers() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:pdpb.GetRegionResponse.pending_peers) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_pending_peers(); -} -inline const ::metapb::Peer& GetRegionResponse::pending_peers(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetRegionResponse.pending_peers) - return _internal_pending_peers().Get(index); -} -inline ::metapb::Peer* GetRegionResponse::add_pending_peers() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::metapb::Peer* _add = _internal_mutable_pending_peers()->Add(); - // @@protoc_insertion_point(field_add:pdpb.GetRegionResponse.pending_peers) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& GetRegionResponse::pending_peers() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:pdpb.GetRegionResponse.pending_peers) - return _internal_pending_peers(); -} -inline const ::google::protobuf::RepeatedPtrField<::metapb::Peer>& -GetRegionResponse::_internal_pending_peers() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.pending_peers_; -} -inline ::google::protobuf::RepeatedPtrField<::metapb::Peer>* -GetRegionResponse::_internal_mutable_pending_peers() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.pending_peers_; -} - -// ------------------------------------------------------------------- - -// GetStoreRequest - -// .pdpb.RequestHeader header = 1; -inline bool GetStoreRequest::has_header() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.header_ != nullptr); - return value; -} -inline void GetStoreRequest::clear_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.header_ != nullptr) _impl_.header_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::pdpb::RequestHeader& GetStoreRequest::_internal_header() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::RequestHeader* p = _impl_.header_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_RequestHeader_default_instance_); -} -inline const ::pdpb::RequestHeader& GetStoreRequest::header() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetStoreRequest.header) - return _internal_header(); -} -inline void GetStoreRequest::unsafe_arena_set_allocated_header(::pdpb::RequestHeader* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.header_); - } - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetStoreRequest.header) -} -inline ::pdpb::RequestHeader* GetStoreRequest::release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::RequestHeader* released = _impl_.header_; - _impl_.header_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::RequestHeader* GetStoreRequest::unsafe_arena_release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetStoreRequest.header) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::RequestHeader* temp = _impl_.header_; - _impl_.header_ = nullptr; - return temp; -} -inline ::pdpb::RequestHeader* GetStoreRequest::_internal_mutable_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.header_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::RequestHeader>(GetArena()); - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(p); - } - return _impl_.header_; -} -inline ::pdpb::RequestHeader* GetStoreRequest::mutable_header() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::RequestHeader* _msg = _internal_mutable_header(); - // @@protoc_insertion_point(field_mutable:pdpb.GetStoreRequest.header) - return _msg; -} -inline void GetStoreRequest::set_allocated_header(::pdpb::RequestHeader* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::RequestHeader*>(_impl_.header_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::RequestHeader*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetStoreRequest.header) -} - -// uint64 store_id = 2; -inline void GetStoreRequest::clear_store_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.store_id_ = ::uint64_t{0u}; -} -inline ::uint64_t GetStoreRequest::store_id() const { - // @@protoc_insertion_point(field_get:pdpb.GetStoreRequest.store_id) - return _internal_store_id(); -} -inline void GetStoreRequest::set_store_id(::uint64_t value) { - _internal_set_store_id(value); - // @@protoc_insertion_point(field_set:pdpb.GetStoreRequest.store_id) -} -inline ::uint64_t GetStoreRequest::_internal_store_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.store_id_; -} -inline void GetStoreRequest::_internal_set_store_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.store_id_ = value; -} - -// ------------------------------------------------------------------- - -// GetStoreResponse - -// .pdpb.ResponseHeader header = 1; -inline bool GetStoreResponse::has_header() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.header_ != nullptr); - return value; -} -inline void GetStoreResponse::clear_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.header_ != nullptr) _impl_.header_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::pdpb::ResponseHeader& GetStoreResponse::_internal_header() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::ResponseHeader* p = _impl_.header_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_ResponseHeader_default_instance_); -} -inline const ::pdpb::ResponseHeader& GetStoreResponse::header() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetStoreResponse.header) - return _internal_header(); -} -inline void GetStoreResponse::unsafe_arena_set_allocated_header(::pdpb::ResponseHeader* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.header_); - } - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetStoreResponse.header) -} -inline ::pdpb::ResponseHeader* GetStoreResponse::release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::ResponseHeader* released = _impl_.header_; - _impl_.header_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::ResponseHeader* GetStoreResponse::unsafe_arena_release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetStoreResponse.header) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::ResponseHeader* temp = _impl_.header_; - _impl_.header_ = nullptr; - return temp; -} -inline ::pdpb::ResponseHeader* GetStoreResponse::_internal_mutable_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.header_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::ResponseHeader>(GetArena()); - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(p); - } - return _impl_.header_; -} -inline ::pdpb::ResponseHeader* GetStoreResponse::mutable_header() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::ResponseHeader* _msg = _internal_mutable_header(); - // @@protoc_insertion_point(field_mutable:pdpb.GetStoreResponse.header) - return _msg; -} -inline void GetStoreResponse::set_allocated_header(::pdpb::ResponseHeader* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::ResponseHeader*>(_impl_.header_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::ResponseHeader*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetStoreResponse.header) -} - -// .metapb.Store store = 2; -inline bool GetStoreResponse::has_store() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.store_ != nullptr); - return value; -} -inline const ::metapb::Store& GetStoreResponse::_internal_store() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::metapb::Store* p = _impl_.store_; - return p != nullptr ? *p : reinterpret_cast(::metapb::_Store_default_instance_); -} -inline const ::metapb::Store& GetStoreResponse::store() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetStoreResponse.store) - return _internal_store(); -} -inline void GetStoreResponse::unsafe_arena_set_allocated_store(::metapb::Store* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.store_); - } - _impl_.store_ = reinterpret_cast<::metapb::Store*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetStoreResponse.store) -} -inline ::metapb::Store* GetStoreResponse::release_store() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000002u; - ::metapb::Store* released = _impl_.store_; - _impl_.store_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::metapb::Store* GetStoreResponse::unsafe_arena_release_store() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetStoreResponse.store) - - _impl_._has_bits_[0] &= ~0x00000002u; - ::metapb::Store* temp = _impl_.store_; - _impl_.store_ = nullptr; - return temp; -} -inline ::metapb::Store* GetStoreResponse::_internal_mutable_store() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.store_ == nullptr) { - auto* p = CreateMaybeMessage<::metapb::Store>(GetArena()); - _impl_.store_ = reinterpret_cast<::metapb::Store*>(p); - } - return _impl_.store_; -} -inline ::metapb::Store* GetStoreResponse::mutable_store() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::metapb::Store* _msg = _internal_mutable_store(); - // @@protoc_insertion_point(field_mutable:pdpb.GetStoreResponse.store) - return _msg; -} -inline void GetStoreResponse::set_allocated_store(::metapb::Store* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.store_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - - _impl_.store_ = reinterpret_cast<::metapb::Store*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetStoreResponse.store) -} - -// ------------------------------------------------------------------- - -// GetMembersRequest - -// .pdpb.RequestHeader header = 1; -inline bool GetMembersRequest::has_header() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.header_ != nullptr); - return value; -} -inline void GetMembersRequest::clear_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.header_ != nullptr) _impl_.header_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::pdpb::RequestHeader& GetMembersRequest::_internal_header() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::RequestHeader* p = _impl_.header_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_RequestHeader_default_instance_); -} -inline const ::pdpb::RequestHeader& GetMembersRequest::header() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetMembersRequest.header) - return _internal_header(); -} -inline void GetMembersRequest::unsafe_arena_set_allocated_header(::pdpb::RequestHeader* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.header_); - } - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetMembersRequest.header) -} -inline ::pdpb::RequestHeader* GetMembersRequest::release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::RequestHeader* released = _impl_.header_; - _impl_.header_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::RequestHeader* GetMembersRequest::unsafe_arena_release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetMembersRequest.header) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::RequestHeader* temp = _impl_.header_; - _impl_.header_ = nullptr; - return temp; -} -inline ::pdpb::RequestHeader* GetMembersRequest::_internal_mutable_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.header_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::RequestHeader>(GetArena()); - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(p); - } - return _impl_.header_; -} -inline ::pdpb::RequestHeader* GetMembersRequest::mutable_header() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::RequestHeader* _msg = _internal_mutable_header(); - // @@protoc_insertion_point(field_mutable:pdpb.GetMembersRequest.header) - return _msg; -} -inline void GetMembersRequest::set_allocated_header(::pdpb::RequestHeader* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::RequestHeader*>(_impl_.header_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::RequestHeader*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.header_ = reinterpret_cast<::pdpb::RequestHeader*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetMembersRequest.header) -} - -// ------------------------------------------------------------------- - -// Member - -// string name = 1; -inline void Member::clear_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.name_.ClearToEmpty(); -} -inline const std::string& Member::name() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.Member.name) - return _internal_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Member::set_name(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.name_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:pdpb.Member.name) -} -inline std::string* Member::mutable_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:pdpb.Member.name) - return _s; -} -inline const std::string& Member::_internal_name() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.name_.Get(); -} -inline void Member::_internal_set_name(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.name_.Set(value, GetArena()); -} -inline std::string* Member::_internal_mutable_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.name_.Mutable( GetArena()); -} -inline std::string* Member::release_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.Member.name) - return _impl_.name_.Release(); -} -inline void Member::set_allocated_name(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.name_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:pdpb.Member.name) -} - -// uint64 member_id = 2; -inline void Member::clear_member_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.member_id_ = ::uint64_t{0u}; -} -inline ::uint64_t Member::member_id() const { - // @@protoc_insertion_point(field_get:pdpb.Member.member_id) - return _internal_member_id(); -} -inline void Member::set_member_id(::uint64_t value) { - _internal_set_member_id(value); - // @@protoc_insertion_point(field_set:pdpb.Member.member_id) -} -inline ::uint64_t Member::_internal_member_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.member_id_; -} -inline void Member::_internal_set_member_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.member_id_ = value; -} - -// repeated string peer_urls = 3; -inline int Member::_internal_peer_urls_size() const { - return _internal_peer_urls().size(); -} -inline int Member::peer_urls_size() const { - return _internal_peer_urls_size(); -} -inline void Member::clear_peer_urls() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.peer_urls_.Clear(); -} -inline std::string* Member::add_peer_urls() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - std::string* _s = _internal_mutable_peer_urls()->Add(); - // @@protoc_insertion_point(field_add_mutable:pdpb.Member.peer_urls) - return _s; -} -inline const std::string& Member::peer_urls(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.Member.peer_urls) - return _internal_peer_urls().Get(index); -} -inline std::string* Member::mutable_peer_urls(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:pdpb.Member.peer_urls) - return _internal_mutable_peer_urls()->Mutable(index); -} -inline void Member::set_peer_urls(int index, const std::string& value) { - _internal_mutable_peer_urls()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:pdpb.Member.peer_urls) -} -inline void Member::set_peer_urls(int index, std::string&& value) { - _internal_mutable_peer_urls()->Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:pdpb.Member.peer_urls) -} -inline void Member::set_peer_urls(int index, const char* value) { - ABSL_DCHECK(value != nullptr); - _internal_mutable_peer_urls()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:pdpb.Member.peer_urls) -} -inline void Member::set_peer_urls(int index, const char* value, - std::size_t size) { - _internal_mutable_peer_urls()->Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:pdpb.Member.peer_urls) -} -inline void Member::set_peer_urls(int index, absl::string_view value) { - _internal_mutable_peer_urls()->Mutable(index)->assign(value.data(), - value.size()); - // @@protoc_insertion_point(field_set_string_piece:pdpb.Member.peer_urls) -} -inline void Member::add_peer_urls(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_peer_urls()->Add()->assign(value); - // @@protoc_insertion_point(field_add:pdpb.Member.peer_urls) -} -inline void Member::add_peer_urls(std::string&& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_peer_urls()->Add(std::move(value)); - // @@protoc_insertion_point(field_add:pdpb.Member.peer_urls) -} -inline void Member::add_peer_urls(const char* value) { - ABSL_DCHECK(value != nullptr); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_peer_urls()->Add()->assign(value); - // @@protoc_insertion_point(field_add_char:pdpb.Member.peer_urls) -} -inline void Member::add_peer_urls(const char* value, std::size_t size) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_peer_urls()->Add()->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:pdpb.Member.peer_urls) -} -inline void Member::add_peer_urls(absl::string_view value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_peer_urls()->Add()->assign(value.data(), value.size()); - // @@protoc_insertion_point(field_add_string_piece:pdpb.Member.peer_urls) -} -inline const ::google::protobuf::RepeatedPtrField& -Member::peer_urls() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:pdpb.Member.peer_urls) - return _internal_peer_urls(); -} -inline ::google::protobuf::RepeatedPtrField* -Member::mutable_peer_urls() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:pdpb.Member.peer_urls) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_peer_urls(); -} -inline const ::google::protobuf::RepeatedPtrField& -Member::_internal_peer_urls() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.peer_urls_; -} -inline ::google::protobuf::RepeatedPtrField* -Member::_internal_mutable_peer_urls() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.peer_urls_; -} - -// repeated string client_urls = 4; -inline int Member::_internal_client_urls_size() const { - return _internal_client_urls().size(); -} -inline int Member::client_urls_size() const { - return _internal_client_urls_size(); -} -inline void Member::clear_client_urls() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.client_urls_.Clear(); -} -inline std::string* Member::add_client_urls() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - std::string* _s = _internal_mutable_client_urls()->Add(); - // @@protoc_insertion_point(field_add_mutable:pdpb.Member.client_urls) - return _s; -} -inline const std::string& Member::client_urls(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.Member.client_urls) - return _internal_client_urls().Get(index); -} -inline std::string* Member::mutable_client_urls(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:pdpb.Member.client_urls) - return _internal_mutable_client_urls()->Mutable(index); -} -inline void Member::set_client_urls(int index, const std::string& value) { - _internal_mutable_client_urls()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set:pdpb.Member.client_urls) -} -inline void Member::set_client_urls(int index, std::string&& value) { - _internal_mutable_client_urls()->Mutable(index)->assign(std::move(value)); - // @@protoc_insertion_point(field_set:pdpb.Member.client_urls) -} -inline void Member::set_client_urls(int index, const char* value) { - ABSL_DCHECK(value != nullptr); - _internal_mutable_client_urls()->Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:pdpb.Member.client_urls) -} -inline void Member::set_client_urls(int index, const char* value, - std::size_t size) { - _internal_mutable_client_urls()->Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:pdpb.Member.client_urls) -} -inline void Member::set_client_urls(int index, absl::string_view value) { - _internal_mutable_client_urls()->Mutable(index)->assign(value.data(), - value.size()); - // @@protoc_insertion_point(field_set_string_piece:pdpb.Member.client_urls) -} -inline void Member::add_client_urls(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_client_urls()->Add()->assign(value); - // @@protoc_insertion_point(field_add:pdpb.Member.client_urls) -} -inline void Member::add_client_urls(std::string&& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_client_urls()->Add(std::move(value)); - // @@protoc_insertion_point(field_add:pdpb.Member.client_urls) -} -inline void Member::add_client_urls(const char* value) { - ABSL_DCHECK(value != nullptr); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_client_urls()->Add()->assign(value); - // @@protoc_insertion_point(field_add_char:pdpb.Member.client_urls) -} -inline void Member::add_client_urls(const char* value, std::size_t size) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_client_urls()->Add()->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:pdpb.Member.client_urls) -} -inline void Member::add_client_urls(absl::string_view value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _internal_mutable_client_urls()->Add()->assign(value.data(), value.size()); - // @@protoc_insertion_point(field_add_string_piece:pdpb.Member.client_urls) -} -inline const ::google::protobuf::RepeatedPtrField& -Member::client_urls() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:pdpb.Member.client_urls) - return _internal_client_urls(); -} -inline ::google::protobuf::RepeatedPtrField* -Member::mutable_client_urls() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:pdpb.Member.client_urls) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_client_urls(); -} -inline const ::google::protobuf::RepeatedPtrField& -Member::_internal_client_urls() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.client_urls_; -} -inline ::google::protobuf::RepeatedPtrField* -Member::_internal_mutable_client_urls() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.client_urls_; -} - -// string leader_name = 5; -inline void Member::clear_leader_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.leader_name_.ClearToEmpty(); -} -inline const std::string& Member::leader_name() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.Member.leader_name) - return _internal_leader_name(); -} -template -inline PROTOBUF_ALWAYS_INLINE void Member::set_leader_name(Arg_&& arg, - Args_... args) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.leader_name_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:pdpb.Member.leader_name) -} -inline std::string* Member::mutable_leader_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - std::string* _s = _internal_mutable_leader_name(); - // @@protoc_insertion_point(field_mutable:pdpb.Member.leader_name) - return _s; -} -inline const std::string& Member::_internal_leader_name() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.leader_name_.Get(); -} -inline void Member::_internal_set_leader_name(const std::string& value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.leader_name_.Set(value, GetArena()); -} -inline std::string* Member::_internal_mutable_leader_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - return _impl_.leader_name_.Mutable( GetArena()); -} -inline std::string* Member::release_leader_name() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.Member.leader_name) - return _impl_.leader_name_.Release(); -} -inline void Member::set_allocated_leader_name(std::string* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.leader_name_.SetAllocated(value, GetArena()); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.leader_name_.IsDefault()) { - _impl_.leader_name_.Set("", GetArena()); - } - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - // @@protoc_insertion_point(field_set_allocated:pdpb.Member.leader_name) -} - -// uint64 leader_id = 6; -inline void Member::clear_leader_id() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.leader_id_ = ::uint64_t{0u}; -} -inline ::uint64_t Member::leader_id() const { - // @@protoc_insertion_point(field_get:pdpb.Member.leader_id) - return _internal_leader_id(); -} -inline void Member::set_leader_id(::uint64_t value) { - _internal_set_leader_id(value); - // @@protoc_insertion_point(field_set:pdpb.Member.leader_id) -} -inline ::uint64_t Member::_internal_leader_id() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.leader_id_; -} -inline void Member::_internal_set_leader_id(::uint64_t value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ; - _impl_.leader_id_ = value; -} - -// ------------------------------------------------------------------- - -// GetMembersResponse - -// .pdpb.ResponseHeader header = 1; -inline bool GetMembersResponse::has_header() const { - bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; - PROTOBUF_ASSUME(!value || _impl_.header_ != nullptr); - return value; -} -inline void GetMembersResponse::clear_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.header_ != nullptr) _impl_.header_->Clear(); - _impl_._has_bits_[0] &= ~0x00000001u; -} -inline const ::pdpb::ResponseHeader& GetMembersResponse::_internal_header() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::ResponseHeader* p = _impl_.header_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_ResponseHeader_default_instance_); -} -inline const ::pdpb::ResponseHeader& GetMembersResponse::header() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetMembersResponse.header) - return _internal_header(); -} -inline void GetMembersResponse::unsafe_arena_set_allocated_header(::pdpb::ResponseHeader* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.header_); - } - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetMembersResponse.header) -} -inline ::pdpb::ResponseHeader* GetMembersResponse::release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::ResponseHeader* released = _impl_.header_; - _impl_.header_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::ResponseHeader* GetMembersResponse::unsafe_arena_release_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetMembersResponse.header) - - _impl_._has_bits_[0] &= ~0x00000001u; - ::pdpb::ResponseHeader* temp = _impl_.header_; - _impl_.header_ = nullptr; - return temp; -} -inline ::pdpb::ResponseHeader* GetMembersResponse::_internal_mutable_header() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000001u; - if (_impl_.header_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::ResponseHeader>(GetArena()); - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(p); - } - return _impl_.header_; -} -inline ::pdpb::ResponseHeader* GetMembersResponse::mutable_header() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::ResponseHeader* _msg = _internal_mutable_header(); - // @@protoc_insertion_point(field_mutable:pdpb.GetMembersResponse.header) - return _msg; -} -inline void GetMembersResponse::set_allocated_header(::pdpb::ResponseHeader* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::ResponseHeader*>(_impl_.header_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::ResponseHeader*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000001u; - } else { - _impl_._has_bits_[0] &= ~0x00000001u; - } - - _impl_.header_ = reinterpret_cast<::pdpb::ResponseHeader*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetMembersResponse.header) -} - -// repeated .pdpb.Member members = 2; -inline int GetMembersResponse::_internal_members_size() const { - return _internal_members().size(); -} -inline int GetMembersResponse::members_size() const { - return _internal_members_size(); -} -inline void GetMembersResponse::clear_members() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_.members_.Clear(); -} -inline ::pdpb::Member* GetMembersResponse::mutable_members(int index) - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable:pdpb.GetMembersResponse.members) - return _internal_mutable_members()->Mutable(index); -} -inline ::google::protobuf::RepeatedPtrField<::pdpb::Member>* GetMembersResponse::mutable_members() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_mutable_list:pdpb.GetMembersResponse.members) - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - return _internal_mutable_members(); -} -inline const ::pdpb::Member& GetMembersResponse::members(int index) const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetMembersResponse.members) - return _internal_members().Get(index); -} -inline ::pdpb::Member* GetMembersResponse::add_members() ABSL_ATTRIBUTE_LIFETIME_BOUND { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - ::pdpb::Member* _add = _internal_mutable_members()->Add(); - // @@protoc_insertion_point(field_add:pdpb.GetMembersResponse.members) - return _add; -} -inline const ::google::protobuf::RepeatedPtrField<::pdpb::Member>& GetMembersResponse::members() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_list:pdpb.GetMembersResponse.members) - return _internal_members(); -} -inline const ::google::protobuf::RepeatedPtrField<::pdpb::Member>& -GetMembersResponse::_internal_members() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return _impl_.members_; -} -inline ::google::protobuf::RepeatedPtrField<::pdpb::Member>* -GetMembersResponse::_internal_mutable_members() { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - return &_impl_.members_; -} - -// .pdpb.Member leader = 3; -inline bool GetMembersResponse::has_leader() const { - bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; - PROTOBUF_ASSUME(!value || _impl_.leader_ != nullptr); - return value; -} -inline void GetMembersResponse::clear_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.leader_ != nullptr) _impl_.leader_->Clear(); - _impl_._has_bits_[0] &= ~0x00000002u; -} -inline const ::pdpb::Member& GetMembersResponse::_internal_leader() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::Member* p = _impl_.leader_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_Member_default_instance_); -} -inline const ::pdpb::Member& GetMembersResponse::leader() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetMembersResponse.leader) - return _internal_leader(); -} -inline void GetMembersResponse::unsafe_arena_set_allocated_leader(::pdpb::Member* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.leader_); - } - _impl_.leader_ = reinterpret_cast<::pdpb::Member*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetMembersResponse.leader) -} -inline ::pdpb::Member* GetMembersResponse::release_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000002u; - ::pdpb::Member* released = _impl_.leader_; - _impl_.leader_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::Member* GetMembersResponse::unsafe_arena_release_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetMembersResponse.leader) - - _impl_._has_bits_[0] &= ~0x00000002u; - ::pdpb::Member* temp = _impl_.leader_; - _impl_.leader_ = nullptr; - return temp; -} -inline ::pdpb::Member* GetMembersResponse::_internal_mutable_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000002u; - if (_impl_.leader_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::Member>(GetArena()); - _impl_.leader_ = reinterpret_cast<::pdpb::Member*>(p); - } - return _impl_.leader_; -} -inline ::pdpb::Member* GetMembersResponse::mutable_leader() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::Member* _msg = _internal_mutable_leader(); - // @@protoc_insertion_point(field_mutable:pdpb.GetMembersResponse.leader) - return _msg; -} -inline void GetMembersResponse::set_allocated_leader(::pdpb::Member* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::Member*>(_impl_.leader_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::Member*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000002u; - } else { - _impl_._has_bits_[0] &= ~0x00000002u; - } - - _impl_.leader_ = reinterpret_cast<::pdpb::Member*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetMembersResponse.leader) -} - -// .pdpb.Member etcd_leader = 4; -inline bool GetMembersResponse::has_etcd_leader() const { - bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; - PROTOBUF_ASSUME(!value || _impl_.etcd_leader_ != nullptr); - return value; -} -inline void GetMembersResponse::clear_etcd_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (_impl_.etcd_leader_ != nullptr) _impl_.etcd_leader_->Clear(); - _impl_._has_bits_[0] &= ~0x00000004u; -} -inline const ::pdpb::Member& GetMembersResponse::_internal_etcd_leader() const { - PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); - const ::pdpb::Member* p = _impl_.etcd_leader_; - return p != nullptr ? *p : reinterpret_cast(::pdpb::_Member_default_instance_); -} -inline const ::pdpb::Member& GetMembersResponse::etcd_leader() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:pdpb.GetMembersResponse.etcd_leader) - return _internal_etcd_leader(); -} -inline void GetMembersResponse::unsafe_arena_set_allocated_etcd_leader(::pdpb::Member* value) { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.etcd_leader_); - } - _impl_.etcd_leader_ = reinterpret_cast<::pdpb::Member*>(value); - if (value != nullptr) { - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:pdpb.GetMembersResponse.etcd_leader) -} -inline ::pdpb::Member* GetMembersResponse::release_etcd_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - - _impl_._has_bits_[0] &= ~0x00000004u; - ::pdpb::Member* released = _impl_.etcd_leader_; - _impl_.etcd_leader_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - if (GetArena() == nullptr) { - delete old; - } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArena() != nullptr) { - released = ::google::protobuf::internal::DuplicateIfNonNull(released); - } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return released; -} -inline ::pdpb::Member* GetMembersResponse::unsafe_arena_release_etcd_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - // @@protoc_insertion_point(field_release:pdpb.GetMembersResponse.etcd_leader) - - _impl_._has_bits_[0] &= ~0x00000004u; - ::pdpb::Member* temp = _impl_.etcd_leader_; - _impl_.etcd_leader_ = nullptr; - return temp; -} -inline ::pdpb::Member* GetMembersResponse::_internal_mutable_etcd_leader() { - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - _impl_._has_bits_[0] |= 0x00000004u; - if (_impl_.etcd_leader_ == nullptr) { - auto* p = CreateMaybeMessage<::pdpb::Member>(GetArena()); - _impl_.etcd_leader_ = reinterpret_cast<::pdpb::Member*>(p); - } - return _impl_.etcd_leader_; -} -inline ::pdpb::Member* GetMembersResponse::mutable_etcd_leader() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::pdpb::Member* _msg = _internal_mutable_etcd_leader(); - // @@protoc_insertion_point(field_mutable:pdpb.GetMembersResponse.etcd_leader) - return _msg; -} -inline void GetMembersResponse::set_allocated_etcd_leader(::pdpb::Member* value) { - ::google::protobuf::Arena* message_arena = GetArena(); - PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); - if (message_arena == nullptr) { - delete reinterpret_cast<::pdpb::Member*>(_impl_.etcd_leader_); - } - - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::pdpb::Member*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - _impl_._has_bits_[0] |= 0x00000004u; - } else { - _impl_._has_bits_[0] &= ~0x00000004u; - } - - _impl_.etcd_leader_ = reinterpret_cast<::pdpb::Member*>(value); - // @@protoc_insertion_point(field_set_allocated:pdpb.GetMembersResponse.etcd_leader) -} - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) -} // namespace pdpb - - -namespace google { -namespace protobuf { - -template <> -struct is_proto_enum<::pdpb::ErrorType> : std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor<::pdpb::ErrorType>() { - return ::pdpb::ErrorType_descriptor(); -} - -} // namespace protobuf -} // namespace google - -// @@protoc_insertion_point(global_scope) - -#include "google/protobuf/port_undef.inc" - -#endif // GOOGLE_PROTOBUF_INCLUDED_pdpb_2eproto_2epb_2eh diff --git a/ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.cc b/ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.cc deleted file mode 100644 index 7a6ef03f9..000000000 --- a/ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.cc +++ /dev/null @@ -1,464 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: tikvpb.proto - -#include "tikvpb.pb.h" -#include "tikvpb.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace tikvpb { - -static const char* Tikv_method_names[] = { - "/tikvpb.Tikv/RawGet", - "/tikvpb.Tikv/RawBatchGet", - "/tikvpb.Tikv/RawPut", - "/tikvpb.Tikv/RawBatchPut", - "/tikvpb.Tikv/RawDelete", - "/tikvpb.Tikv/RawBatchDelete", - "/tikvpb.Tikv/RawDeleteRange", - "/tikvpb.Tikv/RawCompareAndSwap", - "/tikvpb.Tikv/RawScan", - "/tikvpb.Tikv/RawCoprocessor", -}; - -std::unique_ptr< Tikv::Stub> Tikv::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< Tikv::Stub> stub(new Tikv::Stub(channel, options)); - return stub; -} - -Tikv::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) - : channel_(channel), rpcmethod_RawGet_(Tikv_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawBatchGet_(Tikv_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawPut_(Tikv_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawBatchPut_(Tikv_method_names[3], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawDelete_(Tikv_method_names[4], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawBatchDelete_(Tikv_method_names[5], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawDeleteRange_(Tikv_method_names[6], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawCompareAndSwap_(Tikv_method_names[7], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawScan_(Tikv_method_names[8], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_RawCoprocessor_(Tikv_method_names[9], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) - {} - -::grpc::Status Tikv::Stub::RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::kvrpcpb::RawGetResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawGet_, context, request, response); -} - -void Tikv::Stub::async::RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawGet_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawGet_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>* Tikv::Stub::PrepareAsyncRawGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawGetResponse, ::kvrpcpb::RawGetRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawGet_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>* Tikv::Stub::AsyncRawGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawGetRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::kvrpcpb::RawBatchGetResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawBatchGet_, context, request, response); -} - -void Tikv::Stub::async::RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawBatchGet_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawBatchGet_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>* Tikv::Stub::PrepareAsyncRawBatchGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawBatchGetResponse, ::kvrpcpb::RawBatchGetRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawBatchGet_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>* Tikv::Stub::AsyncRawBatchGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawBatchGetRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::kvrpcpb::RawPutResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawPut_, context, request, response); -} - -void Tikv::Stub::async::RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawPut_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawPut_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>* Tikv::Stub::PrepareAsyncRawPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawPutResponse, ::kvrpcpb::RawPutRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawPut_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>* Tikv::Stub::AsyncRawPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawPutRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::kvrpcpb::RawBatchPutResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawBatchPut_, context, request, response); -} - -void Tikv::Stub::async::RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawBatchPut_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawBatchPut_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>* Tikv::Stub::PrepareAsyncRawBatchPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawBatchPutResponse, ::kvrpcpb::RawBatchPutRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawBatchPut_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>* Tikv::Stub::AsyncRawBatchPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawBatchPutRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::kvrpcpb::RawDeleteResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawDelete_, context, request, response); -} - -void Tikv::Stub::async::RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawDelete_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawDelete_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>* Tikv::Stub::PrepareAsyncRawDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawDeleteResponse, ::kvrpcpb::RawDeleteRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawDelete_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>* Tikv::Stub::AsyncRawDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawDeleteRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::kvrpcpb::RawBatchDeleteResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawBatchDelete_, context, request, response); -} - -void Tikv::Stub::async::RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawBatchDelete_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawBatchDelete_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>* Tikv::Stub::PrepareAsyncRawBatchDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawBatchDeleteResponse, ::kvrpcpb::RawBatchDeleteRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawBatchDelete_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>* Tikv::Stub::AsyncRawBatchDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawBatchDeleteRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::kvrpcpb::RawDeleteRangeResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawDeleteRange_, context, request, response); -} - -void Tikv::Stub::async::RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawDeleteRange_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawDeleteRange_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>* Tikv::Stub::PrepareAsyncRawDeleteRangeRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawDeleteRangeResponse, ::kvrpcpb::RawDeleteRangeRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawDeleteRange_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>* Tikv::Stub::AsyncRawDeleteRangeRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawDeleteRangeRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::kvrpcpb::RawCASResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawCompareAndSwap_, context, request, response); -} - -void Tikv::Stub::async::RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawCompareAndSwap_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawCompareAndSwap_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>* Tikv::Stub::PrepareAsyncRawCompareAndSwapRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawCASResponse, ::kvrpcpb::RawCASRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawCompareAndSwap_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>* Tikv::Stub::AsyncRawCompareAndSwapRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawCompareAndSwapRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::kvrpcpb::RawScanResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawScan_, context, request, response); -} - -void Tikv::Stub::async::RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawScan_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawScan_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>* Tikv::Stub::PrepareAsyncRawScanRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawScanResponse, ::kvrpcpb::RawScanRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawScan_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>* Tikv::Stub::AsyncRawScanRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawScanRaw(context, request, cq); - result->StartCall(); - return result; -} - -::grpc::Status Tikv::Stub::RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::kvrpcpb::RawCoprocessorResponse* response) { - return ::grpc::internal::BlockingUnaryCall< ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_RawCoprocessor_, context, request, response); -} - -void Tikv::Stub::async::RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response, std::function f) { - ::grpc::internal::CallbackUnaryCall< ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawCoprocessor_, context, request, response, std::move(f)); -} - -void Tikv::Stub::async::RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_RawCoprocessor_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>* Tikv::Stub::PrepareAsyncRawCoprocessorRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::kvrpcpb::RawCoprocessorResponse, ::kvrpcpb::RawCoprocessorRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_RawCoprocessor_, context, request); -} - -::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>* Tikv::Stub::AsyncRawCoprocessorRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) { - auto* result = - this->PrepareAsyncRawCoprocessorRaw(context, request, cq); - result->StartCall(); - return result; -} - -Tikv::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawGetRequest* req, - ::kvrpcpb::RawGetResponse* resp) { - return service->RawGet(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[1], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawBatchGetRequest* req, - ::kvrpcpb::RawBatchGetResponse* resp) { - return service->RawBatchGet(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[2], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawPutRequest* req, - ::kvrpcpb::RawPutResponse* resp) { - return service->RawPut(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[3], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawBatchPutRequest* req, - ::kvrpcpb::RawBatchPutResponse* resp) { - return service->RawBatchPut(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[4], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawDeleteRequest* req, - ::kvrpcpb::RawDeleteResponse* resp) { - return service->RawDelete(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[5], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawBatchDeleteRequest* req, - ::kvrpcpb::RawBatchDeleteResponse* resp) { - return service->RawBatchDelete(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[6], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawDeleteRangeRequest* req, - ::kvrpcpb::RawDeleteRangeResponse* resp) { - return service->RawDeleteRange(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[7], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawCASRequest* req, - ::kvrpcpb::RawCASResponse* resp) { - return service->RawCompareAndSwap(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[8], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawScanRequest* req, - ::kvrpcpb::RawScanResponse* resp) { - return service->RawScan(ctx, req, resp); - }, this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Tikv_method_names[9], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Tikv::Service, ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( - [](Tikv::Service* service, - ::grpc::ServerContext* ctx, - const ::kvrpcpb::RawCoprocessorRequest* req, - ::kvrpcpb::RawCoprocessorResponse* resp) { - return service->RawCoprocessor(ctx, req, resp); - }, this))); -} - -Tikv::Service::~Service() { -} - -::grpc::Status Tikv::Service::RawGet(::grpc::ServerContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawBatchGet(::grpc::ServerContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawPut(::grpc::ServerContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawBatchPut(::grpc::ServerContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawDelete(::grpc::ServerContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawBatchDelete(::grpc::ServerContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawDeleteRange(::grpc::ServerContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawCompareAndSwap(::grpc::ServerContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawScan(::grpc::ServerContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Tikv::Service::RawCoprocessor(::grpc::ServerContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace tikvpb - diff --git a/ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.h b/ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.h deleted file mode 100644 index aaad73a2a..000000000 --- a/ThirdParty/kvproto/generated/kvproto/tikvpb.grpc.pb.h +++ /dev/null @@ -1,1661 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: tikvpb.proto -// Original file comments: -// Extracted from https://github.com/pingcap/kvproto -// Minimal definitions for SPANN TiKV integration - TiKV gRPC service. -// -#ifndef GRPC_tikvpb_2eproto__INCLUDED -#define GRPC_tikvpb_2eproto__INCLUDED - -#include "tikvpb.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace tikvpb { - -// The TiKV service definition - only RawKV-related RPCs. -class Tikv final { - public: - static constexpr char const* service_full_name() { - return "tikvpb.Tikv"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - // RawKV commands - virtual ::grpc::Status RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::kvrpcpb::RawGetResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawGetResponse>> AsyncRawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawGetResponse>>(AsyncRawGetRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawGetResponse>> PrepareAsyncRawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawGetResponse>>(PrepareAsyncRawGetRaw(context, request, cq)); - } - virtual ::grpc::Status RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::kvrpcpb::RawBatchGetResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchGetResponse>> AsyncRawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchGetResponse>>(AsyncRawBatchGetRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchGetResponse>> PrepareAsyncRawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchGetResponse>>(PrepareAsyncRawBatchGetRaw(context, request, cq)); - } - virtual ::grpc::Status RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::kvrpcpb::RawPutResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawPutResponse>> AsyncRawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawPutResponse>>(AsyncRawPutRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawPutResponse>> PrepareAsyncRawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawPutResponse>>(PrepareAsyncRawPutRaw(context, request, cq)); - } - virtual ::grpc::Status RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::kvrpcpb::RawBatchPutResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchPutResponse>> AsyncRawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchPutResponse>>(AsyncRawBatchPutRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchPutResponse>> PrepareAsyncRawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchPutResponse>>(PrepareAsyncRawBatchPutRaw(context, request, cq)); - } - virtual ::grpc::Status RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::kvrpcpb::RawDeleteResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteResponse>> AsyncRawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteResponse>>(AsyncRawDeleteRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteResponse>> PrepareAsyncRawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteResponse>>(PrepareAsyncRawDeleteRaw(context, request, cq)); - } - virtual ::grpc::Status RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::kvrpcpb::RawBatchDeleteResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchDeleteResponse>> AsyncRawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchDeleteResponse>>(AsyncRawBatchDeleteRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchDeleteResponse>> PrepareAsyncRawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchDeleteResponse>>(PrepareAsyncRawBatchDeleteRaw(context, request, cq)); - } - virtual ::grpc::Status RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::kvrpcpb::RawDeleteRangeResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteRangeResponse>> AsyncRawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteRangeResponse>>(AsyncRawDeleteRangeRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteRangeResponse>> PrepareAsyncRawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteRangeResponse>>(PrepareAsyncRawDeleteRangeRaw(context, request, cq)); - } - virtual ::grpc::Status RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::kvrpcpb::RawCASResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCASResponse>> AsyncRawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCASResponse>>(AsyncRawCompareAndSwapRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCASResponse>> PrepareAsyncRawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCASResponse>>(PrepareAsyncRawCompareAndSwapRaw(context, request, cq)); - } - virtual ::grpc::Status RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::kvrpcpb::RawScanResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawScanResponse>> AsyncRawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawScanResponse>>(AsyncRawScanRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawScanResponse>> PrepareAsyncRawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawScanResponse>>(PrepareAsyncRawScanRaw(context, request, cq)); - } - virtual ::grpc::Status RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::kvrpcpb::RawCoprocessorResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCoprocessorResponse>> AsyncRawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCoprocessorResponse>>(AsyncRawCoprocessorRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCoprocessorResponse>> PrepareAsyncRawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCoprocessorResponse>>(PrepareAsyncRawCoprocessorRaw(context, request, cq)); - } - class async_interface { - public: - virtual ~async_interface() {} - // RawKV commands - virtual void RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response, std::function) = 0; - virtual void RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response, std::function) = 0; - virtual void RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response, std::function) = 0; - virtual void RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response, std::function) = 0; - virtual void RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response, std::function) = 0; - virtual void RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response, std::function) = 0; - virtual void RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response, std::function) = 0; - virtual void RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response, std::function) = 0; - virtual void RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response, std::function) = 0; - virtual void RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response, std::function) = 0; - virtual void RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0; - }; - typedef class async_interface experimental_async_interface; - virtual class async_interface* async() { return nullptr; } - class async_interface* experimental_async() { return async(); } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawGetResponse>* AsyncRawGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawGetResponse>* PrepareAsyncRawGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchGetResponse>* AsyncRawBatchGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchGetResponse>* PrepareAsyncRawBatchGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawPutResponse>* AsyncRawPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawPutResponse>* PrepareAsyncRawPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchPutResponse>* AsyncRawBatchPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchPutResponse>* PrepareAsyncRawBatchPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteResponse>* AsyncRawDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteResponse>* PrepareAsyncRawDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchDeleteResponse>* AsyncRawBatchDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawBatchDeleteResponse>* PrepareAsyncRawBatchDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteRangeResponse>* AsyncRawDeleteRangeRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawDeleteRangeResponse>* PrepareAsyncRawDeleteRangeRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCASResponse>* AsyncRawCompareAndSwapRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCASResponse>* PrepareAsyncRawCompareAndSwapRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawScanResponse>* AsyncRawScanRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawScanResponse>* PrepareAsyncRawScanRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCoprocessorResponse>* AsyncRawCoprocessorRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::kvrpcpb::RawCoprocessorResponse>* PrepareAsyncRawCoprocessorRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); - ::grpc::Status RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::kvrpcpb::RawGetResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>> AsyncRawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>>(AsyncRawGetRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>> PrepareAsyncRawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>>(PrepareAsyncRawGetRaw(context, request, cq)); - } - ::grpc::Status RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::kvrpcpb::RawBatchGetResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>> AsyncRawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>>(AsyncRawBatchGetRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>> PrepareAsyncRawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>>(PrepareAsyncRawBatchGetRaw(context, request, cq)); - } - ::grpc::Status RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::kvrpcpb::RawPutResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>> AsyncRawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>>(AsyncRawPutRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>> PrepareAsyncRawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>>(PrepareAsyncRawPutRaw(context, request, cq)); - } - ::grpc::Status RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::kvrpcpb::RawBatchPutResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>> AsyncRawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>>(AsyncRawBatchPutRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>> PrepareAsyncRawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>>(PrepareAsyncRawBatchPutRaw(context, request, cq)); - } - ::grpc::Status RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::kvrpcpb::RawDeleteResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>> AsyncRawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>>(AsyncRawDeleteRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>> PrepareAsyncRawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>>(PrepareAsyncRawDeleteRaw(context, request, cq)); - } - ::grpc::Status RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::kvrpcpb::RawBatchDeleteResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>> AsyncRawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>>(AsyncRawBatchDeleteRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>> PrepareAsyncRawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>>(PrepareAsyncRawBatchDeleteRaw(context, request, cq)); - } - ::grpc::Status RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::kvrpcpb::RawDeleteRangeResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>> AsyncRawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>>(AsyncRawDeleteRangeRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>> PrepareAsyncRawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>>(PrepareAsyncRawDeleteRangeRaw(context, request, cq)); - } - ::grpc::Status RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::kvrpcpb::RawCASResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>> AsyncRawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>>(AsyncRawCompareAndSwapRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>> PrepareAsyncRawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>>(PrepareAsyncRawCompareAndSwapRaw(context, request, cq)); - } - ::grpc::Status RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::kvrpcpb::RawScanResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>> AsyncRawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>>(AsyncRawScanRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>> PrepareAsyncRawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>>(PrepareAsyncRawScanRaw(context, request, cq)); - } - ::grpc::Status RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::kvrpcpb::RawCoprocessorResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>> AsyncRawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>>(AsyncRawCoprocessorRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>> PrepareAsyncRawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>>(PrepareAsyncRawCoprocessorRaw(context, request, cq)); - } - class async final : - public StubInterface::async_interface { - public: - void RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response, std::function) override; - void RawGet(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response, std::function) override; - void RawBatchGet(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response, std::function) override; - void RawPut(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response, std::function) override; - void RawBatchPut(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response, std::function) override; - void RawDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response, std::function) override; - void RawBatchDelete(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response, std::function) override; - void RawDeleteRange(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response, std::function) override; - void RawCompareAndSwap(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response, std::function) override; - void RawScan(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - void RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response, std::function) override; - void RawCoprocessor(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response, ::grpc::ClientUnaryReactor* reactor) override; - private: - friend class Stub; - explicit async(Stub* stub): stub_(stub) { } - Stub* stub() { return stub_; } - Stub* stub_; - }; - class async* async() override { return &async_stub_; } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - class async async_stub_{this}; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>* AsyncRawGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawGetResponse>* PrepareAsyncRawGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawGetRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>* AsyncRawBatchGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchGetResponse>* PrepareAsyncRawBatchGetRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchGetRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>* AsyncRawPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawPutResponse>* PrepareAsyncRawPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawPutRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>* AsyncRawBatchPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchPutResponse>* PrepareAsyncRawBatchPutRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchPutRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>* AsyncRawDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteResponse>* PrepareAsyncRawDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>* AsyncRawBatchDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawBatchDeleteResponse>* PrepareAsyncRawBatchDeleteRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawBatchDeleteRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>* AsyncRawDeleteRangeRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawDeleteRangeResponse>* PrepareAsyncRawDeleteRangeRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawDeleteRangeRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>* AsyncRawCompareAndSwapRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCASResponse>* PrepareAsyncRawCompareAndSwapRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCASRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>* AsyncRawScanRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawScanResponse>* PrepareAsyncRawScanRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawScanRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>* AsyncRawCoprocessorRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::kvrpcpb::RawCoprocessorResponse>* PrepareAsyncRawCoprocessorRaw(::grpc::ClientContext* context, const ::kvrpcpb::RawCoprocessorRequest& request, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_RawGet_; - const ::grpc::internal::RpcMethod rpcmethod_RawBatchGet_; - const ::grpc::internal::RpcMethod rpcmethod_RawPut_; - const ::grpc::internal::RpcMethod rpcmethod_RawBatchPut_; - const ::grpc::internal::RpcMethod rpcmethod_RawDelete_; - const ::grpc::internal::RpcMethod rpcmethod_RawBatchDelete_; - const ::grpc::internal::RpcMethod rpcmethod_RawDeleteRange_; - const ::grpc::internal::RpcMethod rpcmethod_RawCompareAndSwap_; - const ::grpc::internal::RpcMethod rpcmethod_RawScan_; - const ::grpc::internal::RpcMethod rpcmethod_RawCoprocessor_; - }; - static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); - - class Service : public ::grpc::Service { - public: - Service(); - virtual ~Service(); - // RawKV commands - virtual ::grpc::Status RawGet(::grpc::ServerContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response); - virtual ::grpc::Status RawBatchGet(::grpc::ServerContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response); - virtual ::grpc::Status RawPut(::grpc::ServerContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response); - virtual ::grpc::Status RawBatchPut(::grpc::ServerContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response); - virtual ::grpc::Status RawDelete(::grpc::ServerContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response); - virtual ::grpc::Status RawBatchDelete(::grpc::ServerContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response); - virtual ::grpc::Status RawDeleteRange(::grpc::ServerContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response); - virtual ::grpc::Status RawCompareAndSwap(::grpc::ServerContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response); - virtual ::grpc::Status RawScan(::grpc::ServerContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response); - virtual ::grpc::Status RawCoprocessor(::grpc::ServerContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response); - }; - template - class WithAsyncMethod_RawGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawGet() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_RawGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawGetRequest* /*request*/, ::kvrpcpb::RawGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawGet(::grpc::ServerContext* context, ::kvrpcpb::RawGetRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawGetResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawBatchGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawBatchGet() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_RawBatchGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchGetRequest* /*request*/, ::kvrpcpb::RawBatchGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawBatchGet(::grpc::ServerContext* context, ::kvrpcpb::RawBatchGetRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawBatchGetResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawPut() { - ::grpc::Service::MarkMethodAsync(2); - } - ~WithAsyncMethod_RawPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawPutRequest* /*request*/, ::kvrpcpb::RawPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawPut(::grpc::ServerContext* context, ::kvrpcpb::RawPutRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawPutResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawBatchPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawBatchPut() { - ::grpc::Service::MarkMethodAsync(3); - } - ~WithAsyncMethod_RawBatchPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchPutRequest* /*request*/, ::kvrpcpb::RawBatchPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawBatchPut(::grpc::ServerContext* context, ::kvrpcpb::RawBatchPutRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawBatchPutResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawDelete() { - ::grpc::Service::MarkMethodAsync(4); - } - ~WithAsyncMethod_RawDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRequest* /*request*/, ::kvrpcpb::RawDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawDelete(::grpc::ServerContext* context, ::kvrpcpb::RawDeleteRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawDeleteResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawBatchDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawBatchDelete() { - ::grpc::Service::MarkMethodAsync(5); - } - ~WithAsyncMethod_RawBatchDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchDeleteRequest* /*request*/, ::kvrpcpb::RawBatchDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawBatchDelete(::grpc::ServerContext* context, ::kvrpcpb::RawBatchDeleteRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawBatchDeleteResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawDeleteRange : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawDeleteRange() { - ::grpc::Service::MarkMethodAsync(6); - } - ~WithAsyncMethod_RawDeleteRange() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDeleteRange(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRangeRequest* /*request*/, ::kvrpcpb::RawDeleteRangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawDeleteRange(::grpc::ServerContext* context, ::kvrpcpb::RawDeleteRangeRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawDeleteRangeResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawCompareAndSwap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawCompareAndSwap() { - ::grpc::Service::MarkMethodAsync(7); - } - ~WithAsyncMethod_RawCompareAndSwap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCompareAndSwap(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCASRequest* /*request*/, ::kvrpcpb::RawCASResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawCompareAndSwap(::grpc::ServerContext* context, ::kvrpcpb::RawCASRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawCASResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawScan : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawScan() { - ::grpc::Service::MarkMethodAsync(8); - } - ~WithAsyncMethod_RawScan() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawScan(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawScanRequest* /*request*/, ::kvrpcpb::RawScanResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawScan(::grpc::ServerContext* context, ::kvrpcpb::RawScanRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawScanResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_RawCoprocessor : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_RawCoprocessor() { - ::grpc::Service::MarkMethodAsync(9); - } - ~WithAsyncMethod_RawCoprocessor() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCoprocessor(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCoprocessorRequest* /*request*/, ::kvrpcpb::RawCoprocessorResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawCoprocessor(::grpc::ServerContext* context, ::kvrpcpb::RawCoprocessorRequest* request, ::grpc::ServerAsyncResponseWriter< ::kvrpcpb::RawCoprocessorResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag); - } - }; - typedef WithAsyncMethod_RawGet > > > > > > > > > AsyncService; - template - class WithCallbackMethod_RawGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawGet() { - ::grpc::Service::MarkMethodCallback(0, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawGetRequest* request, ::kvrpcpb::RawGetResponse* response) { return this->RawGet(context, request, response); }));} - void SetMessageAllocatorFor_RawGet( - ::grpc::MessageAllocator< ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawGetRequest* /*request*/, ::kvrpcpb::RawGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawGet( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawGetRequest* /*request*/, ::kvrpcpb::RawGetResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawBatchGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawBatchGet() { - ::grpc::Service::MarkMethodCallback(1, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawBatchGetRequest* request, ::kvrpcpb::RawBatchGetResponse* response) { return this->RawBatchGet(context, request, response); }));} - void SetMessageAllocatorFor_RawBatchGet( - ::grpc::MessageAllocator< ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawBatchGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchGetRequest* /*request*/, ::kvrpcpb::RawBatchGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawBatchGet( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawBatchGetRequest* /*request*/, ::kvrpcpb::RawBatchGetResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawPut() { - ::grpc::Service::MarkMethodCallback(2, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawPutRequest* request, ::kvrpcpb::RawPutResponse* response) { return this->RawPut(context, request, response); }));} - void SetMessageAllocatorFor_RawPut( - ::grpc::MessageAllocator< ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawPutRequest* /*request*/, ::kvrpcpb::RawPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawPut( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawPutRequest* /*request*/, ::kvrpcpb::RawPutResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawBatchPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawBatchPut() { - ::grpc::Service::MarkMethodCallback(3, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawBatchPutRequest* request, ::kvrpcpb::RawBatchPutResponse* response) { return this->RawBatchPut(context, request, response); }));} - void SetMessageAllocatorFor_RawBatchPut( - ::grpc::MessageAllocator< ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(3); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawBatchPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchPutRequest* /*request*/, ::kvrpcpb::RawBatchPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawBatchPut( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawBatchPutRequest* /*request*/, ::kvrpcpb::RawBatchPutResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawDelete() { - ::grpc::Service::MarkMethodCallback(4, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawDeleteRequest* request, ::kvrpcpb::RawDeleteResponse* response) { return this->RawDelete(context, request, response); }));} - void SetMessageAllocatorFor_RawDelete( - ::grpc::MessageAllocator< ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(4); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRequest* /*request*/, ::kvrpcpb::RawDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawDelete( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawDeleteRequest* /*request*/, ::kvrpcpb::RawDeleteResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawBatchDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawBatchDelete() { - ::grpc::Service::MarkMethodCallback(5, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawBatchDeleteRequest* request, ::kvrpcpb::RawBatchDeleteResponse* response) { return this->RawBatchDelete(context, request, response); }));} - void SetMessageAllocatorFor_RawBatchDelete( - ::grpc::MessageAllocator< ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(5); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawBatchDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchDeleteRequest* /*request*/, ::kvrpcpb::RawBatchDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawBatchDelete( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawBatchDeleteRequest* /*request*/, ::kvrpcpb::RawBatchDeleteResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawDeleteRange : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawDeleteRange() { - ::grpc::Service::MarkMethodCallback(6, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawDeleteRangeRequest* request, ::kvrpcpb::RawDeleteRangeResponse* response) { return this->RawDeleteRange(context, request, response); }));} - void SetMessageAllocatorFor_RawDeleteRange( - ::grpc::MessageAllocator< ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(6); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawDeleteRange() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDeleteRange(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRangeRequest* /*request*/, ::kvrpcpb::RawDeleteRangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawDeleteRange( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawDeleteRangeRequest* /*request*/, ::kvrpcpb::RawDeleteRangeResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawCompareAndSwap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawCompareAndSwap() { - ::grpc::Service::MarkMethodCallback(7, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawCASRequest* request, ::kvrpcpb::RawCASResponse* response) { return this->RawCompareAndSwap(context, request, response); }));} - void SetMessageAllocatorFor_RawCompareAndSwap( - ::grpc::MessageAllocator< ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(7); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawCompareAndSwap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCompareAndSwap(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCASRequest* /*request*/, ::kvrpcpb::RawCASResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawCompareAndSwap( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawCASRequest* /*request*/, ::kvrpcpb::RawCASResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawScan : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawScan() { - ::grpc::Service::MarkMethodCallback(8, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawScanRequest* request, ::kvrpcpb::RawScanResponse* response) { return this->RawScan(context, request, response); }));} - void SetMessageAllocatorFor_RawScan( - ::grpc::MessageAllocator< ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(8); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawScan() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawScan(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawScanRequest* /*request*/, ::kvrpcpb::RawScanResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawScan( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawScanRequest* /*request*/, ::kvrpcpb::RawScanResponse* /*response*/) { return nullptr; } - }; - template - class WithCallbackMethod_RawCoprocessor : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithCallbackMethod_RawCoprocessor() { - ::grpc::Service::MarkMethodCallback(9, - new ::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse>( - [this]( - ::grpc::CallbackServerContext* context, const ::kvrpcpb::RawCoprocessorRequest* request, ::kvrpcpb::RawCoprocessorResponse* response) { return this->RawCoprocessor(context, request, response); }));} - void SetMessageAllocatorFor_RawCoprocessor( - ::grpc::MessageAllocator< ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse>* allocator) { - ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(9); - static_cast<::grpc::internal::CallbackUnaryHandler< ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse>*>(handler) - ->SetMessageAllocator(allocator); - } - ~WithCallbackMethod_RawCoprocessor() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCoprocessor(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCoprocessorRequest* /*request*/, ::kvrpcpb::RawCoprocessorResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawCoprocessor( - ::grpc::CallbackServerContext* /*context*/, const ::kvrpcpb::RawCoprocessorRequest* /*request*/, ::kvrpcpb::RawCoprocessorResponse* /*response*/) { return nullptr; } - }; - typedef WithCallbackMethod_RawGet > > > > > > > > > CallbackService; - typedef CallbackService ExperimentalCallbackService; - template - class WithGenericMethod_RawGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawGet() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_RawGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawGetRequest* /*request*/, ::kvrpcpb::RawGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawBatchGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawBatchGet() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_RawBatchGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchGetRequest* /*request*/, ::kvrpcpb::RawBatchGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawPut() { - ::grpc::Service::MarkMethodGeneric(2); - } - ~WithGenericMethod_RawPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawPutRequest* /*request*/, ::kvrpcpb::RawPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawBatchPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawBatchPut() { - ::grpc::Service::MarkMethodGeneric(3); - } - ~WithGenericMethod_RawBatchPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchPutRequest* /*request*/, ::kvrpcpb::RawBatchPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawDelete() { - ::grpc::Service::MarkMethodGeneric(4); - } - ~WithGenericMethod_RawDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRequest* /*request*/, ::kvrpcpb::RawDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawBatchDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawBatchDelete() { - ::grpc::Service::MarkMethodGeneric(5); - } - ~WithGenericMethod_RawBatchDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchDeleteRequest* /*request*/, ::kvrpcpb::RawBatchDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawDeleteRange : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawDeleteRange() { - ::grpc::Service::MarkMethodGeneric(6); - } - ~WithGenericMethod_RawDeleteRange() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDeleteRange(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRangeRequest* /*request*/, ::kvrpcpb::RawDeleteRangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawCompareAndSwap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawCompareAndSwap() { - ::grpc::Service::MarkMethodGeneric(7); - } - ~WithGenericMethod_RawCompareAndSwap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCompareAndSwap(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCASRequest* /*request*/, ::kvrpcpb::RawCASResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawScan : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawScan() { - ::grpc::Service::MarkMethodGeneric(8); - } - ~WithGenericMethod_RawScan() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawScan(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawScanRequest* /*request*/, ::kvrpcpb::RawScanResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_RawCoprocessor : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_RawCoprocessor() { - ::grpc::Service::MarkMethodGeneric(9); - } - ~WithGenericMethod_RawCoprocessor() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCoprocessor(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCoprocessorRequest* /*request*/, ::kvrpcpb::RawCoprocessorResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_RawGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawGet() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_RawGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawGetRequest* /*request*/, ::kvrpcpb::RawGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawGet(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawBatchGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawBatchGet() { - ::grpc::Service::MarkMethodRaw(1); - } - ~WithRawMethod_RawBatchGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchGetRequest* /*request*/, ::kvrpcpb::RawBatchGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawBatchGet(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawPut() { - ::grpc::Service::MarkMethodRaw(2); - } - ~WithRawMethod_RawPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawPutRequest* /*request*/, ::kvrpcpb::RawPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawPut(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawBatchPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawBatchPut() { - ::grpc::Service::MarkMethodRaw(3); - } - ~WithRawMethod_RawBatchPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchPutRequest* /*request*/, ::kvrpcpb::RawBatchPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawBatchPut(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(3, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawDelete() { - ::grpc::Service::MarkMethodRaw(4); - } - ~WithRawMethod_RawDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRequest* /*request*/, ::kvrpcpb::RawDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawDelete(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(4, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawBatchDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawBatchDelete() { - ::grpc::Service::MarkMethodRaw(5); - } - ~WithRawMethod_RawBatchDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchDeleteRequest* /*request*/, ::kvrpcpb::RawBatchDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawBatchDelete(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(5, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawDeleteRange : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawDeleteRange() { - ::grpc::Service::MarkMethodRaw(6); - } - ~WithRawMethod_RawDeleteRange() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDeleteRange(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRangeRequest* /*request*/, ::kvrpcpb::RawDeleteRangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawDeleteRange(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(6, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawCompareAndSwap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawCompareAndSwap() { - ::grpc::Service::MarkMethodRaw(7); - } - ~WithRawMethod_RawCompareAndSwap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCompareAndSwap(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCASRequest* /*request*/, ::kvrpcpb::RawCASResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawCompareAndSwap(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(7, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawScan : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawScan() { - ::grpc::Service::MarkMethodRaw(8); - } - ~WithRawMethod_RawScan() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawScan(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawScanRequest* /*request*/, ::kvrpcpb::RawScanResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawScan(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(8, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_RawCoprocessor : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_RawCoprocessor() { - ::grpc::Service::MarkMethodRaw(9); - } - ~WithRawMethod_RawCoprocessor() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCoprocessor(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCoprocessorRequest* /*request*/, ::kvrpcpb::RawCoprocessorResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRawCoprocessor(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(9, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawCallbackMethod_RawGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawGet() { - ::grpc::Service::MarkMethodRawCallback(0, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawGet(context, request, response); })); - } - ~WithRawCallbackMethod_RawGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawGetRequest* /*request*/, ::kvrpcpb::RawGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawGet( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawBatchGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawBatchGet() { - ::grpc::Service::MarkMethodRawCallback(1, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawBatchGet(context, request, response); })); - } - ~WithRawCallbackMethod_RawBatchGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchGetRequest* /*request*/, ::kvrpcpb::RawBatchGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawBatchGet( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawPut() { - ::grpc::Service::MarkMethodRawCallback(2, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawPut(context, request, response); })); - } - ~WithRawCallbackMethod_RawPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawPutRequest* /*request*/, ::kvrpcpb::RawPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawPut( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawBatchPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawBatchPut() { - ::grpc::Service::MarkMethodRawCallback(3, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawBatchPut(context, request, response); })); - } - ~WithRawCallbackMethod_RawBatchPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchPutRequest* /*request*/, ::kvrpcpb::RawBatchPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawBatchPut( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawDelete() { - ::grpc::Service::MarkMethodRawCallback(4, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawDelete(context, request, response); })); - } - ~WithRawCallbackMethod_RawDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRequest* /*request*/, ::kvrpcpb::RawDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawDelete( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawBatchDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawBatchDelete() { - ::grpc::Service::MarkMethodRawCallback(5, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawBatchDelete(context, request, response); })); - } - ~WithRawCallbackMethod_RawBatchDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawBatchDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchDeleteRequest* /*request*/, ::kvrpcpb::RawBatchDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawBatchDelete( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawDeleteRange : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawDeleteRange() { - ::grpc::Service::MarkMethodRawCallback(6, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawDeleteRange(context, request, response); })); - } - ~WithRawCallbackMethod_RawDeleteRange() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawDeleteRange(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRangeRequest* /*request*/, ::kvrpcpb::RawDeleteRangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawDeleteRange( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawCompareAndSwap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawCompareAndSwap() { - ::grpc::Service::MarkMethodRawCallback(7, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawCompareAndSwap(context, request, response); })); - } - ~WithRawCallbackMethod_RawCompareAndSwap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCompareAndSwap(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCASRequest* /*request*/, ::kvrpcpb::RawCASResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawCompareAndSwap( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawScan : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawScan() { - ::grpc::Service::MarkMethodRawCallback(8, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawScan(context, request, response); })); - } - ~WithRawCallbackMethod_RawScan() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawScan(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawScanRequest* /*request*/, ::kvrpcpb::RawScanResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawScan( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithRawCallbackMethod_RawCoprocessor : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawCallbackMethod_RawCoprocessor() { - ::grpc::Service::MarkMethodRawCallback(9, - new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this]( - ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->RawCoprocessor(context, request, response); })); - } - ~WithRawCallbackMethod_RawCoprocessor() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status RawCoprocessor(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCoprocessorRequest* /*request*/, ::kvrpcpb::RawCoprocessorResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::ServerUnaryReactor* RawCoprocessor( - ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } - }; - template - class WithStreamedUnaryMethod_RawGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawGet() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawGetRequest, ::kvrpcpb::RawGetResponse>* streamer) { - return this->StreamedRawGet(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawGetRequest* /*request*/, ::kvrpcpb::RawGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawGet(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawGetRequest,::kvrpcpb::RawGetResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawBatchGet : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawBatchGet() { - ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawBatchGetRequest, ::kvrpcpb::RawBatchGetResponse>* streamer) { - return this->StreamedRawBatchGet(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawBatchGet() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawBatchGet(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchGetRequest* /*request*/, ::kvrpcpb::RawBatchGetResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawBatchGet(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawBatchGetRequest,::kvrpcpb::RawBatchGetResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawPut() { - ::grpc::Service::MarkMethodStreamed(2, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawPutRequest, ::kvrpcpb::RawPutResponse>* streamer) { - return this->StreamedRawPut(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawPutRequest* /*request*/, ::kvrpcpb::RawPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawPut(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawPutRequest,::kvrpcpb::RawPutResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawBatchPut : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawBatchPut() { - ::grpc::Service::MarkMethodStreamed(3, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawBatchPutRequest, ::kvrpcpb::RawBatchPutResponse>* streamer) { - return this->StreamedRawBatchPut(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawBatchPut() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawBatchPut(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchPutRequest* /*request*/, ::kvrpcpb::RawBatchPutResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawBatchPut(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawBatchPutRequest,::kvrpcpb::RawBatchPutResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawDelete() { - ::grpc::Service::MarkMethodStreamed(4, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawDeleteRequest, ::kvrpcpb::RawDeleteResponse>* streamer) { - return this->StreamedRawDelete(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRequest* /*request*/, ::kvrpcpb::RawDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawDelete(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawDeleteRequest,::kvrpcpb::RawDeleteResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawBatchDelete : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawBatchDelete() { - ::grpc::Service::MarkMethodStreamed(5, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawBatchDeleteRequest, ::kvrpcpb::RawBatchDeleteResponse>* streamer) { - return this->StreamedRawBatchDelete(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawBatchDelete() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawBatchDelete(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawBatchDeleteRequest* /*request*/, ::kvrpcpb::RawBatchDeleteResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawBatchDelete(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawBatchDeleteRequest,::kvrpcpb::RawBatchDeleteResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawDeleteRange : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawDeleteRange() { - ::grpc::Service::MarkMethodStreamed(6, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawDeleteRangeRequest, ::kvrpcpb::RawDeleteRangeResponse>* streamer) { - return this->StreamedRawDeleteRange(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawDeleteRange() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawDeleteRange(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawDeleteRangeRequest* /*request*/, ::kvrpcpb::RawDeleteRangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawDeleteRange(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawDeleteRangeRequest,::kvrpcpb::RawDeleteRangeResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawCompareAndSwap : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawCompareAndSwap() { - ::grpc::Service::MarkMethodStreamed(7, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawCASRequest, ::kvrpcpb::RawCASResponse>* streamer) { - return this->StreamedRawCompareAndSwap(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawCompareAndSwap() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawCompareAndSwap(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCASRequest* /*request*/, ::kvrpcpb::RawCASResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawCompareAndSwap(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawCASRequest,::kvrpcpb::RawCASResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawScan : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawScan() { - ::grpc::Service::MarkMethodStreamed(8, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawScanRequest, ::kvrpcpb::RawScanResponse>* streamer) { - return this->StreamedRawScan(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawScan() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawScan(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawScanRequest* /*request*/, ::kvrpcpb::RawScanResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawScan(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawScanRequest,::kvrpcpb::RawScanResponse>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_RawCoprocessor : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_RawCoprocessor() { - ::grpc::Service::MarkMethodStreamed(9, - new ::grpc::internal::StreamedUnaryHandler< - ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse>( - [this](::grpc::ServerContext* context, - ::grpc::ServerUnaryStreamer< - ::kvrpcpb::RawCoprocessorRequest, ::kvrpcpb::RawCoprocessorResponse>* streamer) { - return this->StreamedRawCoprocessor(context, - streamer); - })); - } - ~WithStreamedUnaryMethod_RawCoprocessor() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status RawCoprocessor(::grpc::ServerContext* /*context*/, const ::kvrpcpb::RawCoprocessorRequest* /*request*/, ::kvrpcpb::RawCoprocessorResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRawCoprocessor(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::kvrpcpb::RawCoprocessorRequest,::kvrpcpb::RawCoprocessorResponse>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_RawGet > > > > > > > > > StreamedUnaryService; - typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_RawGet > > > > > > > > > StreamedService; -}; - -} // namespace tikvpb - - -#endif // GRPC_tikvpb_2eproto__INCLUDED diff --git a/ThirdParty/kvproto/generated/kvproto/tikvpb.pb.cc b/ThirdParty/kvproto/generated/kvproto/tikvpb.pb.cc deleted file mode 100644 index 3a2d4679e..000000000 --- a/ThirdParty/kvproto/generated/kvproto/tikvpb.pb.cc +++ /dev/null @@ -1,103 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tikvpb.proto - -#include "tikvpb.pb.h" - -#include -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/extension_set.h" -#include "google/protobuf/wire_format_lite.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/reflection_ops.h" -#include "google/protobuf/wire_format.h" -#include "google/protobuf/generated_message_tctable_impl.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" -PROTOBUF_PRAGMA_INIT_SEG -namespace _pb = ::google::protobuf; -namespace _pbi = ::google::protobuf::internal; -namespace _fl = ::google::protobuf::internal::field_layout; -namespace tikvpb { -} // namespace tikvpb -static constexpr const ::_pb::EnumDescriptor** - file_level_enum_descriptors_tikvpb_2eproto = nullptr; -static constexpr const ::_pb::ServiceDescriptor** - file_level_service_descriptors_tikvpb_2eproto = nullptr; -const ::uint32_t TableStruct_tikvpb_2eproto::offsets[1] = {}; -static constexpr ::_pbi::MigrationSchema* schemas = nullptr; -static constexpr ::_pb::Message* const* file_default_instances = nullptr; -const char descriptor_table_protodef_tikvpb_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - "\n\014tikvpb.proto\022\006tikvpb\032\rkvrpcpb.proto2\345\005" - "\n\004Tikv\022;\n\006RawGet\022\026.kvrpcpb.RawGetRequest" - "\032\027.kvrpcpb.RawGetResponse\"\000\022J\n\013RawBatchG" - "et\022\033.kvrpcpb.RawBatchGetRequest\032\034.kvrpcp" - "b.RawBatchGetResponse\"\000\022;\n\006RawPut\022\026.kvrp" - "cpb.RawPutRequest\032\027.kvrpcpb.RawPutRespon" - "se\"\000\022J\n\013RawBatchPut\022\033.kvrpcpb.RawBatchPu" - "tRequest\032\034.kvrpcpb.RawBatchPutResponse\"\000" - "\022D\n\tRawDelete\022\031.kvrpcpb.RawDeleteRequest" - "\032\032.kvrpcpb.RawDeleteResponse\"\000\022S\n\016RawBat" - "chDelete\022\036.kvrpcpb.RawBatchDeleteRequest" - "\032\037.kvrpcpb.RawBatchDeleteResponse\"\000\022S\n\016R" - "awDeleteRange\022\036.kvrpcpb.RawDeleteRangeRe" - "quest\032\037.kvrpcpb.RawDeleteRangeResponse\"\000" - "\022F\n\021RawCompareAndSwap\022\026.kvrpcpb.RawCASRe" - "quest\032\027.kvrpcpb.RawCASResponse\"\000\022>\n\007RawS" - "can\022\027.kvrpcpb.RawScanRequest\032\030.kvrpcpb.R" - "awScanResponse\"\000\022S\n\016RawCoprocessor\022\036.kvr" - "pcpb.RawCoprocessorRequest\032\037.kvrpcpb.Raw" - "CoprocessorResponse\"\000B\022\n\020org.tikv.kvprot" - "ob\006proto3" -}; -static const ::_pbi::DescriptorTable* const descriptor_table_tikvpb_2eproto_deps[1] = - { - &::descriptor_table_kvrpcpb_2eproto, -}; -static ::absl::once_flag descriptor_table_tikvpb_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_tikvpb_2eproto = { - false, - false, - 809, - descriptor_table_protodef_tikvpb_2eproto, - "tikvpb.proto", - &descriptor_table_tikvpb_2eproto_once, - descriptor_table_tikvpb_2eproto_deps, - 1, - 0, - schemas, - file_default_instances, - TableStruct_tikvpb_2eproto::offsets, - nullptr, - file_level_enum_descriptors_tikvpb_2eproto, - file_level_service_descriptors_tikvpb_2eproto, -}; - -// This function exists to be marked as weak. -// It can significantly speed up compilation by breaking up LLVM's SCC -// in the .pb.cc translation units. Large translation units see a -// reduction of more than 35% of walltime for optimized builds. Without -// the weak attribute all the messages in the file, including all the -// vtables and everything they use become part of the same SCC through -// a cycle like: -// GetMetadata -> descriptor table -> default instances -> -// vtables -> GetMetadata -// By adding a weak function here we break the connection from the -// individual vtables back into the descriptor table. -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_tikvpb_2eproto_getter() { - return &descriptor_table_tikvpb_2eproto; -} -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 -static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_tikvpb_2eproto(&descriptor_table_tikvpb_2eproto); -namespace tikvpb { -// @@protoc_insertion_point(namespace_scope) -} // namespace tikvpb -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google -// @@protoc_insertion_point(global_scope) -#include "google/protobuf/port_undef.inc" diff --git a/ThirdParty/kvproto/generated/kvproto/tikvpb.pb.h b/ThirdParty/kvproto/generated/kvproto/tikvpb.pb.h deleted file mode 100644 index 9ab1157bf..000000000 --- a/ThirdParty/kvproto/generated/kvproto/tikvpb.pb.h +++ /dev/null @@ -1,92 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tikvpb.proto -// Protobuf C++ Version: 4.25.3 - -#ifndef GOOGLE_PROTOBUF_INCLUDED_tikvpb_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_tikvpb_2eproto_2epb_2eh - -#include -#include -#include -#include - -#include "google/protobuf/port_def.inc" -#if PROTOBUF_VERSION < 4025000 -#error "This file was generated by a newer version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please update" -#error "your headers." -#endif // PROTOBUF_VERSION - -#if 4025003 < PROTOBUF_MIN_PROTOC_VERSION -#error "This file was generated by an older version of protoc which is" -#error "incompatible with your Protocol Buffer headers. Please" -#error "regenerate this file with a newer version of protoc." -#endif // PROTOBUF_MIN_PROTOC_VERSION -#include "google/protobuf/port_undef.inc" -#include "google/protobuf/io/coded_stream.h" -#include "google/protobuf/arena.h" -#include "google/protobuf/arenastring.h" -#include "google/protobuf/generated_message_tctable_decl.h" -#include "google/protobuf/generated_message_util.h" -#include "google/protobuf/metadata_lite.h" -#include "google/protobuf/generated_message_reflection.h" -#include "google/protobuf/repeated_field.h" // IWYU pragma: export -#include "google/protobuf/extension_set.h" // IWYU pragma: export -#include "kvrpcpb.pb.h" -// @@protoc_insertion_point(includes) - -// Must be included last. -#include "google/protobuf/port_def.inc" - -#define PROTOBUF_INTERNAL_EXPORT_tikvpb_2eproto - -namespace google { -namespace protobuf { -namespace internal { -class AnyMetadata; -} // namespace internal -} // namespace protobuf -} // namespace google - -// Internal implementation detail -- do not use these members. -struct TableStruct_tikvpb_2eproto { - static const ::uint32_t offsets[]; -}; -extern const ::google::protobuf::internal::DescriptorTable - descriptor_table_tikvpb_2eproto; -namespace google { -namespace protobuf { -} // namespace protobuf -} // namespace google - -namespace tikvpb { - -// =================================================================== - - - -// =================================================================== - - - - -// =================================================================== - - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - -// @@protoc_insertion_point(namespace_scope) -} // namespace tikvpb - - -// @@protoc_insertion_point(global_scope) - -#include "google/protobuf/port_undef.inc" - -#endif // GOOGLE_PROTOBUF_INCLUDED_tikvpb_2eproto_2epb_2eh